### Eclipse Workspace Patch 1.0 #P org.apache.stanbol.reasoners.web Index: src/main/resources/META-INF/static/images/organization_48.png =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: src/main/resources/META-INF/templates/imports/sparql.ftl =================================================================== --- src/main/resources/META-INF/templates/imports/sparql.ftl (revision 1148250) +++ src/main/resources/META-INF/templates/imports/sparql.ftl (working copy) @@ -1,65 +0,0 @@ -<#-- - Licensed to the Apache Software Foundation (ASF) under one or more - contributor license agreements. See the NOTICE file distributed with - this work for additional information regarding copyright ownership. - The ASF licenses this file to You under the Apache License, Version 2.0 - (the "License"); you may not use this file except in compliance with - the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. ---> -<#macro form> -
- -

- -
- - \ No newline at end of file Index: src/main/resources/META-INF/static/images/foldable_unfolded.png =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: src/main/resources/META-INF/static/style/images/date-top.gif =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: src/main/resources/META-INF/static/images/foldable_folded.png =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: src/main/resources/META-INF/static/images/favicon-sw.png =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: src/main/resources/META-INF/templates/imports/contentitem.ftl =================================================================== --- src/main/resources/META-INF/templates/imports/contentitem.ftl (revision 1148250) +++ src/main/resources/META-INF/templates/imports/contentitem.ftl (working copy) @@ -1,56 +0,0 @@ -<#-- - Licensed to the Apache Software Foundation (ASF) under one or more - contributor license agreements. See the NOTICE file distributed with - this work for additional information regarding copyright ownership. - The ASF licenses this file to You under the Apache License, Version 2.0 - (the "License"); you may not use this file except in compliance with - the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. ---> -<#import "/imports/entities.ftl" as entities> -<#macro view> - -
-<#if it.personOccurrences?size != 0 || it.organizationOccurrences?size != 0 || it.placeOccurrences?size != 0> -

Extracted entities

- - -
-<#if it.personOccurrences?size != 0> -

People

-<@entities.listing entities=it.personOccurrences - iconsrc="/static/images/user_48.png" /> - -
- -
-<#if it.organizationOccurrences?size != 0> -

Organizations

-<@entities.listing entities=it.organizationOccurrences - iconsrc="/static/images/organization_48.png" /> - -
- -
-<#if it.placeOccurrences?size != 0> -

Places

-<@entities.listing entities=it.placeOccurrences - iconsrc="/static/images/compass_48.png" /> - -
-
-
- - - \ No newline at end of file Index: src/main/resources/META-INF/static/images/fise_logo_white_small.png =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: src/main/resources/META-INF/static/images/favicon-black.png =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: src/main/resources/META-INF/static/scripts/jit-yc.js =================================================================== --- src/main/resources/META-INF/static/scripts/jit-yc.js (revision 1148250) +++ src/main/resources/META-INF/static/scripts/jit-yc.js (working copy) @@ -1,27 +0,0 @@ -/* - Copyright (c) 2010, Nicolas Garcia Belmonte - All rights reserved - - > Redistribution and use in source and binary forms, with or without - > modification, are permitted provided that the following conditions are met: - > * Redistributions of source code must retain the above copyright - > notice, this list of conditions and the following disclaimer. - > * Redistributions in binary form must reproduce the above copyright - > notice, this list of conditions and the following disclaimer in the - > documentation and/or other materials provided with the distribution. - > * Neither the name of the organization nor the - > names of its contributors may be used to endorse or promote products - > derived from this software without specific prior written permission. - > - > THIS SOFTWARE IS PROVIDED BY NICOLAS GARCIA BELMONTE ``AS IS'' AND ANY - > EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - > WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - > DISCLAIMED. IN NO EVENT SHALL NICOLAS GARCIA BELMONTE BE LIABLE FOR ANY - > DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - > (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - > LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - > ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - > (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - > SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - (function(){window.$jit=function(x){x=x||window;for(var y in $jit){if($jit[y].$extend){x[y]=$jit[y]}}};$jit.version="2.0.0b";var c=function(w){return document.getElementById(w)};c.empty=function(){};c.extend=function(y,w){for(var x in (w||{})){y[x]=w[x]}return y};c.lambda=function(w){return(typeof w=="function")?w:function(){return w}};c.time=Date.now||function(){return +new Date};c.splat=function(x){var w=c.type(x);return w?((w!="array")?[x]:x):[]};c.type=function(x){var w=c.type.s.call(x).match(/^\[object\s(.*)\]$/)[1].toLowerCase();if(w!="object"){return w}if(x&&x.$$family){return x.$$family}return(x&&x.nodeName&&x.nodeType==1)?"element":w};c.type.s=Object.prototype.toString;c.each=function(B,A){var z=c.type(B);if(z=="object"){for(var y in B){A(B[y],y)}}else{for(var x=0,w=B.length;x>16,y>>8&255,y&255]}};c.destroy=function(w){c.clean(w);if(w.parentNode){w.parentNode.removeChild(w)}if(w.clearAttributes){w.clearAttributes()}};c.clean=function(z){for(var y=z.childNodes,x=0,w=y.length;x-1};c.addClass=function(x,w){if(!c.hasClass(x,w)){x.className=(x.className+" "+w)}};c.removeClass=function(x,w){x.className=x.className.replace(new RegExp("(^|\\s)"+w+"(?:\\s|$)"),"$1")};c.getPos=function(y){var B=A(y);var w=z(y);return{x:B.x-w.x,y:B.y-w.y};function A(D){var C={x:0,y:0};while(D&&!x(D)){C.x+=D.offsetLeft;C.y+=D.offsetTop;D=D.offsetParent}return C}function z(D){var C={x:0,y:0};while(D&&!x(D)){C.x+=D.scrollLeft;C.y+=D.scrollTop;D=D.parentNode}return C}function x(C){return(/^(?:body|html)$/i).test(C.tagName)}};c.event={get:function(x,w){w=w||window;return x||w.event},getWheel:function(w){return w.wheelDelta?w.wheelDelta/120:-(w.detail||0)/3},isRightClick:function(w){return(w.which==3||w.button==2)},getPos:function(z,y){y=y||window;z=z||y.event;var x=y.document;x=x.documentElement||x.body;if(z.touches&&z.touches.length){z=z.touches[0]}var w={x:z.pageX||(z.clientX+x.scrollLeft),y:z.pageY||(z.clientY+x.scrollTop)};return w},stop:function(w){if(w.stopPropagation){w.stopPropagation()}w.cancelBubble=true;if(w.preventDefault){w.preventDefault()}else{w.returnValue=false}}};$jit.util=$jit.id=c;var q=function(x){x=x||{};var w=function(){for(var A in this){if(typeof this[A]!="function"){this[A]=c.unlink(this[A])}}this.constructor=w;if(q.prototyping){return this}var z=this.initialize?this.initialize.apply(this,arguments):this;this.$$family="class";return z};for(var y in q.Mutators){if(!x[y]){continue}x=q.Mutators[y](x,x[y]);delete x[y]}c.extend(w,this);w.constructor=q;w.prototype=x;return w};q.Mutators={Implements:function(w,x){c.each(c.splat(x),function(z){q.prototyping=z;var y=(typeof z=="function")?new z:z;for(var A in y){if(!(A in w)){w[A]=y[A]}}delete q.prototyping});return w}};c.extend(q,{inherit:function(w,z){for(var y in z){var x=z[y];var B=w[y];var A=c.type(x);if(B&&A=="function"){if(x!=B){q.override(w,y,x)}}else{if(A=="object"){w[y]=c.merge(B,x)}else{w[y]=x}}}return w},override:function(x,w,A){var z=q.prototyping;if(z&&x[w]!=z[w]){z=null}var y=function(){var B=this.parent;this.parent=z?z[w]:x[w];var C=A.apply(this,arguments);this.parent=B;return C};x[w]=y}});q.prototype.implement=function(){var w=this.prototype;c.each(Array.prototype.slice.call(arguments||[]),function(x){q.inherit(w,x)});return this};$jit.Class=q;$jit.json={prune:function(x,w){this.each(x,function(z,y){if(y==w&&z.children){delete z.children;z.children=[]}})},getParent:function(w,A){if(w.id==A){return false}var z=w.children;if(z&&z.length>0){for(var y=0;y=(7-4*z)/11){A=y*y-Math.pow((11-6*z-11*B)/4,2);break}}return A},Elastic:function(z,y){return Math.pow(2,10*--z)*Math.cos(20*z*Math.PI*(y[0]||1)/3)}};c.each(x,function(z,y){i[y]=w(z)});c.each(["Quad","Cubic","Quart","Quint"],function(z,y){i[z]=w(function(A){return Math.pow(A,[y+2])})})})();var u=new q({initialize:function(w){this.setOptions(w)},setOptions:function(w){var x={duration:2500,fps:40,transition:i.Quart.easeInOut,compute:c.empty,complete:c.empty,link:"ignore"};this.opt=c.merge(x,w||{});return this},step:function(){var x=c.time(),w=this.opt;if(xD.height)?(F.y-C.height-E):F.y+E)+"px";A.left=((F.x+C.width+w>D.width)?(F.x-C.width-w):F.x+w)+"px"},hide:function(w){this.tip.style.display="none";w&&this.config.onHide()}});o.Classes.NodeStyles=new q({Implements:[t,h],initializePost:function(){this.fx=this.viz.fx;this.types=this.viz.fx.nodeTypes;this.nStyles=this.config;this.nodeStylesOnHover=this.nStyles.stylesHover;this.nodeStylesOnClick=this.nStyles.stylesClick;this.hoveredNode=false;this.fx.nodeFxAnimation=new u();this.down=false;this.move=false},onMouseOut:function(y,x){this.down=this.move=false;if(!this.hoveredNode){return}if(this.dom&&this.isLabel(y,x)){this.toggleStylesOnHover(this.hoveredNode,false)}var w=y.relatedTarget,z=this.canvas.getElement();while(w&&w.parentNode){if(z==w.parentNode){return}w=w.parentNode}this.toggleStylesOnHover(this.hoveredNode,false);this.hoveredNode=false},onMouseOver:function(z,y){var w;if(this.dom&&(w=this.isLabel(z,y))){var x=this.viz.graph.getNode(w.id);if(x.selected){return}this.hoveredNode=x;this.toggleStylesOnHover(this.hoveredNode,true)}},onMouseDown:function(A,z,x,y){if(y){return}var w;if(this.dom&&(w=this.isLabel(A,z))){this.down=this.viz.graph.getNode(w.id)}else{if(!this.dom){this.down=x.getNode()}}this.move=false},onMouseUp:function(z,y,w,x){if(x){return}if(!this.move){this.onClick(w.getNode())}this.down=this.move=false},getRestoredStyles:function(x,w){var z={},y=this["nodeStylesOn"+w];for(var A in y){z[A]=x.styles["$"+A]}return z},toggleStylesOnHover:function(w,x){if(this.nodeStylesOnHover){this.toggleStylesOn("Hover",w,x)}},toggleStylesOnClick:function(w,x){if(this.nodeStylesOnClick){this.toggleStylesOn("Click",w,x)}},toggleStylesOn:function(A,w,C){var D=this.viz;var B=this.nStyles;if(C){var z=this;if(!w.styles){w.styles=c.merge(w.data,{})}for(var E in this["nodeStylesOn"+A]){var x="$"+E;if(!(x in w.styles)){w.styles[x]=w.getData(E)}}D.fx.nodeFx(c.extend({elements:{id:w.id,properties:z["nodeStylesOn"+A]},transition:i.Quart.easeOut,duration:300,fps:40},this.config))}else{var y=this.getRestoredStyles(w,A);D.fx.nodeFx(c.extend({elements:{id:w.id,properties:y},transition:i.Quart.easeOut,duration:300,fps:40},this.config))}},onClick:function(w){if(!w){return}var x=this.nodeStylesOnClick;if(!x){return}if(w.selected){this.toggleStylesOnClick(w,false);delete w.selected}else{this.viz.graph.eachNode(function(z){if(z.selected){for(var y in x){z.setData(y,z.styles["$"+y],"end")}delete z.selected}});this.toggleStylesOnClick(w,true);w.selected=true;delete w.hovered;this.hoveredNode=false}},onMouseMove:function(C,B,z){if(this.down){this.move=true}if(this.dom&&this.isLabel(C,B)){return}var A=this.nodeStylesOnHover;if(!A){return}if(!this.dom){if(this.hoveredNode){var x=this.types[this.hoveredNode.getData("type")];var w=x&&x.contains&&x.contains.call(this.fx,this.hoveredNode,z.getPos());if(w){return}}var y=z.getNode();if(!this.hoveredNode&&!y){return}if(y.hovered){return}if(y&&!y.selected){this.fx.nodeFxAnimation.stopTimer();this.viz.graph.eachNode(function(E){if(E.hovered&&!E.selected){for(var D in A){E.setData(D,E.styles["$"+D],"end")}delete E.hovered}});y.hovered=true;this.hoveredNode=y;this.toggleStylesOnHover(y,true)}else{if(this.hoveredNode&&!this.hoveredNode.selected){this.fx.nodeFxAnimation.stopTimer();this.toggleStylesOnHover(this.hoveredNode,false);delete this.hoveredNode.hovered;this.hoveredNode=false}}}}});o.Classes.Navigation=new q({Implements:[t,h],initializePost:function(){this.pos=false;this.pressed=false},onMouseWheel:function(z,y,w){if(!this.config.zooming){return}c.event.stop(c.event.get(z,y));var A=this.config.zooming/1000,x=1+w*A;this.canvas.scale(x,x)},onMouseDown:function(B,A,z){if(!this.config.panning){return}if(this.config.panning=="avoid nodes"&&z.getNode()){return}this.pressed=true;this.pos=z.getPos();var y=this.canvas,x=y.translateOffsetX,w=y.translateOffsetY,D=y.scaleOffsetX,C=y.scaleOffsetY;this.pos.x*=D;this.pos.x+=x;this.pos.y*=C;this.pos.y+=w},onMouseMove:function(D,C,F){if(!this.config.panning){return}if(!this.pressed){return}if(this.config.panning=="avoid nodes"&&F.getNode()){return}var B=this.pos,E=F.getPos(),z=this.canvas,A=z.translateOffsetX,w=z.translateOffsetY,J=z.scaleOffsetX,H=z.scaleOffsetY;E.x*=J;E.y*=H;E.x+=A;E.y+=w;var I=E.x-B.x,G=E.y-B.y;this.pos=E;this.canvas.translate(I*1/J,G*1/H)},onMouseUp:function(z,y,x,w){if(!this.config.panning){return}this.pressed=false}});var l;(function(){var w=typeof HTMLCanvasElement,y=(w=="object"||w=="function");function x(z,A){var B=document.createElement(z);for(var C in A){if(typeof A[C]=="object"){c.extend(B[C],A[C])}else{B[C]=A[C]}}if(z=="canvas"&&!y&&G_vmlCanvasManager){B=G_vmlCanvasManager.initElement(document.body.appendChild(B))}return B}$jit.Canvas=l=new q({canvases:[],pos:false,element:false,labelContainer:false,translateOffsetX:0,translateOffsetY:0,scaleOffsetX:1,scaleOffsetY:1,initialize:function(K,E){this.viz=K;this.opt=E;var B=c.type(E.injectInto)=="string"?E.injectInto:E.injectInto.id,C=B+"-label",z=c(B),D=E.width||z.offsetWidth,L=E.height||z.offsetHeight;this.id=B;var F={injectInto:B,width:D,height:L};this.element=x("div",{id:B+"-canvaswidget",style:{position:"relative",width:D+"px",height:L+"px"}});this.labelContainer=this.createLabelContainer(E.Label.type,C,F);this.canvases.push(new l.Base({config:c.extend({idSuffix:"-canvas"},F),plot:function(M){K.fx.plot()},resize:function(){K.refresh()}}));var G=E.background;if(G){var J=new l.Background[G.type](K,c.extend(G,F));this.canvases.push(new l.Base(J))}var I=this.canvases.length;while(I--){this.element.appendChild(this.canvases[I].canvas);if(I>0){this.canvases[I].plot()}}this.element.appendChild(this.labelContainer);z.appendChild(this.element);var A=null,H=this;c.addEvent(window,"scroll",function(){clearTimeout(A);A=setTimeout(function(){H.getPos(true)},500)})},getCtx:function(z){return this.canvases[z||0].getCtx()},getConfig:function(){return this.opt},getElement:function(){return this.element},getSize:function(z){return this.canvases[z||0].getSize()},resize:function(D,z){this.getPos(true);this.translateOffsetX=this.translateOffsetY=0;this.scaleOffsetX=this.scaleOffsetY=1;for(var B=0,A=this.canvases.length;BE){A=x((E+((B-C)-E)*F))}else{A=x((E-C+(B-(E))*F))}}else{if(D>=z){if(B>E){A=x((E+((B-C)-E)*F))}else{A=x((E-C+(B-(E-C))*F))}}else{A=x((E+(B-E)*F))}}var w=(this.rho-y.rho)*F+y.rho;return{theta:A,rho:w}}};var k=function(x,w){return new b(x,w)};b.KER=k(0,0);var p=function(w,z){this.x=w;this.y=z};$jit.Complex=p;p.prototype={getc:function(){return this},getp:function(w){return this.toPolar(w)},set:function(w){w=w.getc(true);this.x=w.x;this.y=w.y},setc:function(w,z){this.x=w;this.y=z},setp:function(x,w){this.x=Math.cos(x)*w;this.y=Math.sin(x)*w},clone:function(){return new p(this.x,this.y)},toPolar:function(y){var w=this.norm();var x=Math.atan2(this.y,this.x);if(x<0){x+=Math.PI*2}if(y){return{theta:x,rho:w}}return new b(x,w)},norm:function(){return Math.sqrt(this.squaredNorm())},squaredNorm:function(){return this.x*this.x+this.y*this.y},add:function(w){return new p(this.x+w.x,this.y+w.y)},prod:function(w){return new p(this.x*w.x-this.y*w.y,this.y*w.x+this.x*w.y)},conjugate:function(){return new p(this.x,-this.y)},scale:function(w){return new p(this.x*w,this.y*w)},equals:function(w){return this.x==w.x&&this.y==w.y},$add:function(w){this.x+=w.x;this.y+=w.y;return this},$prod:function(A){var w=this.x,z=this.y;this.x=w*A.x-z*A.y;this.y=z*A.x+w*A.y;return this},$conjugate:function(){this.y=-this.y;return this},$scale:function(w){this.x*=w;this.y*=w;return this},$div:function(B){var w=this.x,A=this.y;var z=B.squaredNorm();this.x=w*B.x+A*B.y;this.y=A*B.x-w*B.y;return this.$scale(1/z)}};var r=function(x,w){return new p(x,w)};p.KER=r(0,0);$jit.Graph=new q({initialize:function(y,x,w,C){var A={complex:false,Node:{}};this.Node=x;this.Edge=w;this.Label=C;this.opt=c.merge(A,y||{});this.nodes={};this.edges={};var z=this;this.nodeList={};for(var B in j){z.nodeList[B]=(function(D){return function(){var E=Array.prototype.slice.call(arguments);z.eachNode(function(F){F[D].apply(F,E)})}})(B)}},getNode:function(w){if(this.hasNode(w)){return this.nodes[w]}return false},getByName:function(w){for(var y in this.nodes){var x=this.nodes[y];if(x.name==w){return x}}return false},getAdjacence:function(x,w){if(x in this.edges){return this.edges[x][w]}return false},addNode:function(x){if(!this.nodes[x.id]){var w=this.edges[x.id]={};this.nodes[x.id]=new e.Node(c.extend({id:x.id,name:x.name,data:c.merge(x.data||{},{}),adjacencies:w},this.opt.Node),this.opt.complex,this.Node,this.Edge,this.Label)}return this.nodes[x.id]},addAdjacence:function(z,y,x){if(!this.hasNode(z.id)){this.addNode(z)}if(!this.hasNode(y.id)){this.addNode(y)}z=this.nodes[z.id];y=this.nodes[y.id];if(!z.adjacentTo(y)){var A=this.edges[z.id]=this.edges[z.id]||{};var w=this.edges[y.id]=this.edges[y.id]||{};A[y.id]=w[z.id]=new e.Adjacence(z,y,x,this.Edge,this.Label);return A[y.id]}return this.edges[z.id][y.id]},removeNode:function(y){if(this.hasNode(y)){delete this.nodes[y];var x=this.edges[y];for(var w in x){delete this.edges[w][y]}delete this.edges[y]}},removeAdjacence:function(x,w){delete this.edges[x][w];delete this.edges[w][x]},hasNode:function(w){return w in this.nodes},empty:function(){this.nodes={};this.edges={}}});var e=$jit.Graph;var j;(function(){var w=function(D,F,A,C,E){var B;A=A||"current";D="$"+(D?D+"-":"");if(A=="current"){B=this.data}else{if(A=="start"){B=this.startData}else{if(A=="end"){B=this.endData}}}var z=D+F;if(C){return B[z]}if(!this.Config.overridable){return E[F]||0}return(z in B)?B[z]:((z in this.data)?this.data[z]:(E[F]||0))};var y=function(C,D,B,z){z=z||"current";C="$"+(C?C+"-":"");var A;if(z=="current"){A=this.data}else{if(z=="start"){A=this.startData}else{if(z=="end"){A=this.endData}}}A[C+D]=B};var x=function(B,z){B="$"+(B?B+"-":"");var A=this;c.each(z,function(D){var C=B+D;delete A.data[C];delete A.endData[C];delete A.startData[C]})};j={getData:function(B,z,A){return w.call(this,"",B,z,A,this.Config)},setData:function(B,A,z){y.call(this,"",B,A,z)},setDataset:function(C,D){C=c.splat(C);for(var z in D){for(var B=0,E=c.splat(D[z]),A=C.length;B=F&&I<=G&&w(H)){B(H,I)}if(II){y(K,F,G)}})}})(A,E+D,x+D)},eachSubgraph:function(x,y,w){this.eachLevel(x,0,false,y,w)},eachSubnode:function(x,y,w){this.eachLevel(x,1,1,y,w)},anySubnode:function(z,y,x){var w=false;y=y||c.lambda(true);var A=c.type(y)=="string"?function(B){return B[y]}:y;this.eachSubnode(z,function(B){if(A(B)){w=true}},x);return w},getSubnodes:function(B,C,w){var y=[],A=this;C=C||0;var z,x;if(c.type(C)=="array"){z=C[0];x=C[1]}else{z=C;x=Number.MAX_VALUE-B._depth}this.eachLevel(B,z,x,function(D){y.push(D)},w);return y},getParents:function(x){var w=[];this.eachAdjacency(x,function(y){var z=y.nodeTo;if(z._depth-1)){H.endData[J]=G[J]}else{H.data[J]=G[J]}}}});B.graph.eachNode(function(G){if(G.ignore){return}G.eachAdjacency(function(H){if(H.nodeFrom.ignore||H.nodeTo.ignore){return}var I=C.getNode(H.nodeFrom.id);var J=C.getNode(H.nodeTo.id);if(!I.adjacentTo(J)){var H=B.graph.getAdjacence(I.id,J.id);w=true;H.setData("alpha",1);H.setData("alpha",1,"start");H.setData("alpha",0,"end")}})});var w=this.preprocessSum(C);var y=!w?["node-property:alpha"]:["node-property:alpha","edge-property:alpha"];y[0]=y[0]+((z&&("node-property" in z))?(":"+c.splat(z["node-property"]).join(":")):"");y[1]=(y[1]||"edge-property:alpha")+((z&&("edge-property" in z))?(":"+c.splat(z["edge-property"]).join(":")):"");if(z&&("label-property" in z)){y.push("label-property:"+c.splat(z["label-property"]).join(":"))}B.reposition();B.graph.eachNode(function(G){if(G.id!=A&&G.pos.getp().equals(b.KER)){G.pos.set(G.endPos);G.startPos.set(G.endPos)}});B.fx.animate(c.merge(F,{modes:["polar"].concat(y),onComplete:function(){B.graph.eachNode(function(G){if(G.ignore){B.graph.removeNode(G.id)}});B.graph.eachNode(function(G){G.eachAdjacency(function(H){if(H.ignore){B.graph.removeAdjacence(H.nodeFrom.id,H.nodeTo.id)}})});F.onComplete()}}));break;default:}},contract:function(y,x){var w=this.viz;if(y.collapsed||!y.anySubnode(c.lambda(true))){return}x=c.merge(this.options,w.config,x||{},{modes:["node-property:alpha:span","linear"]});y.collapsed=true;(function z(A){A.eachSubnode(function(B){B.ignore=true;B.setData("alpha",0,x.type=="animate"?"end":"current");z(B)})})(y);if(x.type=="animate"){w.compute("end");if(w.rotated){w.rotate(w.rotated,"none",{property:"end"})}(function z(A){A.eachSubnode(function(B){B.setPos(y.getPos("end"),"end");z(B)})})(y);w.fx.animate(x)}else{if(x.type=="replot"){w.refresh()}}},expand:function(y,x){if(!("collapsed" in y)){return}var w=this.viz;x=c.merge(this.options,w.config,x||{},{modes:["node-property:alpha:span","linear"]});delete y.collapsed;(function z(A){A.eachSubnode(function(B){delete B.ignore;B.setData("alpha",1,x.type=="animate"?"end":"current");z(B)})})(y);if(x.type=="animate"){w.compute("end");if(w.rotated){w.rotate(w.rotated,"none",{property:"end"})}w.fx.animate(x)}else{if(x.type=="replot"){w.refresh()}}},preprocessSum:function(x){var w=this.viz;x.eachNode(function(z){if(!w.graph.hasNode(z.id)){w.graph.addNode(z);var A=w.graph.getNode(z.id);A.setData("alpha",0);A.setData("alpha",0,"start");A.setData("alpha",1,"end")}});var y=false;x.eachNode(function(z){z.eachAdjacency(function(A){var B=w.graph.getNode(A.nodeFrom.id);var C=w.graph.getNode(A.nodeTo.id);if(!B.adjacentTo(C)){var A=w.graph.addAdjacence(B,C,A.data);if(B.startAlpha==B.endAlpha&&C.startAlpha==C.endAlpha){y=true;A.setData("alpha",0);A.setData("alpha",0,"start");A.setData("alpha",1,"end")}}})});return y}};var a={none:{render:c.empty,contains:c.lambda(false)},circle:{render:function(z,A,w,y){var x=y.getCtx();x.beginPath();x.arc(A.x,A.y,w,0,Math.PI*2,true);x.closePath();x[z]()},contains:function(B,A,w){var y=B.x-A.x,x=B.y-A.y,z=y*y+x*x;return z<=w*w}},ellipse:{render:function(A,B,z,w,y){var x=y.getCtx();w/=2;z/=2;x.save();x.scale(z/w,w/z);x.beginPath();x.arc(B.x*(w/z),B.y*(z/w),w,0,Math.PI*2,true);x.closePath();x[A]();x.restore()},contains:function(D,C,z,w){z/=2;w/=2;var B=(z+w)/2,y=D.x-C.x,x=D.y-C.y,A=y*y+x*x;return A<=B*B}},square:{render:function(x,z,y,w){w.getCtx()[x+"Rect"](z.x-y,z.y-y,2*y,2*y)},contains:function(y,x,w){return Math.abs(x.x-y.x)<=w&&Math.abs(x.y-y.y)<=w}},rectangle:{render:function(z,A,y,w,x){x.getCtx()[z+"Rect"](A.x-y/2,A.y-w/2,y,w)},contains:function(z,y,x,w){return Math.abs(y.x-z.x)<=x/2&&Math.abs(y.y-z.y)<=w/2}},triangle:{render:function(C,D,z,w){var G=w.getCtx(),y=D.x,x=D.y-z,F=y-z,E=D.y+z,B=y+z,A=E;G.beginPath();G.moveTo(y,x);G.lineTo(F,E);G.lineTo(B,A);G.closePath();G[C]()},contains:function(y,x,w){return a.circle.contains(y,x,w)}},star:{render:function(A,C,B,x){var w=x.getCtx(),z=Math.PI/5;w.save();w.translate(C.x,C.y);w.beginPath();w.moveTo(B,0);for(var y=0;y<9;y++){w.rotate(z);if(y%2==0){w.lineTo((B/0.525731)*0.200811,0)}else{w.lineTo(B,0)}}w.closePath();w[A]();w.restore()},contains:function(y,x,w){return a.circle.contains(y,x,w)}}};var m={line:{render:function(z,y,x){var w=x.getCtx();w.beginPath();w.moveTo(z.x,z.y);w.lineTo(y.x,y.y);w.stroke()},contains:function(G,y,B,E){var z=Math.min,C=Math.max,x=z(G.x,y.x),F=C(G.x,y.x),w=z(G.y,y.y),D=C(G.y,y.y);if(B.x>=x&&B.x<=F&&B.y>=w&&B.y<=D){if(Math.abs(y.x-G.x)<=E){return true}var A=(y.y-G.y)/(y.x-G.x)*(B.x-G.x)+G.y;return Math.abs(A-B.y)<=E}return false}},arrow:{render:function(F,G,z,x,w){var H=w.getCtx();if(x){var y=F;F=G;G=y}var C=new p(G.x-F.x,G.y-F.y);C.$scale(z/C.norm());var A=new p(G.x-C.x,G.y-C.y),B=new p(-C.y/2,C.x/2),E=A.add(B),D=A.$add(B.$scale(-1));H.beginPath();H.moveTo(F.x,F.y);H.lineTo(G.x,G.y);H.stroke();H.beginPath();H.moveTo(E.x,E.y);H.lineTo(D.x,D.y);H.lineTo(G.x,G.y);H.closePath();H.fill()},contains:function(x,w,z,y){return m.line.contains(x,w,z,y)}},hyperline:{render:function(D,E,w,y){var F=y.getCtx();var z=A(D,E);if(z.a>1000||z.b>1000||z.ratio<0){F.beginPath();F.moveTo(D.x*w,D.y*w);F.lineTo(E.x*w,E.y*w);F.stroke()}else{var C=Math.atan2(E.y-z.y,E.x-z.x);var B=Math.atan2(D.y-z.y,D.x-z.x);var x=x(C,B);F.beginPath();F.arc(z.x*w,z.y*w,z.ratio*w,C,B,x);F.stroke()}function A(S,R){var K=(S.x*R.y-S.y*R.x),G=K;var J=S.squaredNorm(),I=R.squaredNorm();if(K==0){return{x:0,y:0,ratio:-1}}var Q=(S.y*I-R.y*J+S.y-R.y)/K;var O=(R.x*J-S.x*I+R.x-S.x)/G;var P=-Q/2;var N=-O/2;var M=(Q*Q+O*O)/4-1;if(M<0){return{x:0,y:0,ratio:-1}}var L=Math.sqrt(M);var H={x:P,y:N,ratio:L>1000?-1:L,a:Q,b:O};return H}function x(G,H){return(GH)?false:true):((H+Math.PI>G)?true:false)}},contains:c.lambda(false)}};e.Plot={initialize:function(x,w){this.viz=x;this.config=x.config;this.node=x.config.Node;this.edge=x.config.Edge;this.animation=new u;this.nodeTypes=new w.Plot.NodeTypes;this.edgeTypes=new w.Plot.EdgeTypes;this.labels=x.labels},nodeHelper:a,edgeHelper:m,Interpolator:{map:{border:"color",color:"color",width:"number",height:"number",dim:"number",alpha:"number",lineWidth:"number",angularWidth:"number",span:"number",valueArray:"array-number",dimArray:"array-number"},canvas:{globalAlpha:"number",fillStyle:"color",strokeStyle:"color",lineWidth:"number",shadowBlur:"number",shadowColor:"color",shadowOffsetX:"number",shadowOffsetY:"number",miterLimit:"number"},label:{size:"number",color:"color"},compute:function(y,x,w){return y+(x-y)*w},moebius:function(D,C,F,z){var B=z.scale(-F);if(B.norm()<1){var w=B.x,E=B.y;var A=D.startPos.getc().moebiusTransformation(B);D.pos.setc(A.x,A.y);B.x=w;B.y=E}},linear:function(x,w,A){var z=x.startPos.getc(true);var y=x.endPos.getc(true);x.pos.setc(this.compute(z.x,y.x,A),this.compute(z.y,y.y,A))},polar:function(y,x,B){var A=y.startPos.getp(true);var z=y.endPos.getp();var w=z.interpolate(A,B);y.pos.setp(w.theta,w.rho)},number:function(x,C,B,w,A){var z=x[w](C,"start");var y=x[w](C,"end");x[A](C,this.compute(z,y,B))},color:function(y,w,E,B,z){var C=c.hexToRgb(y[B](w,"start"));var D=c.hexToRgb(y[B](w,"end"));var A=this.compute;var x=c.rgbToHex([parseInt(A(C[0],D[0],E)),parseInt(A(C[1],D[1],E)),parseInt(A(C[2],D[2],E))]);y[z](w,x)},"array-number":function(z,y,J,G,B){var H=z[G](y,"start"),I=z[G](y,"end"),K=[];for(var E=0,A=H.length;E=0.95){C.labels.plotLabel(y,I,x)}else{C.labels.hideLabel(I,false)}}F.restore();I.visited=!z})},plotTree:function(A,x,E){var B=this,C=this.viz,y=C.canvas,z=this.config,D=y.getCtx();var w=A.getData("alpha");A.eachSubnode(function(G){if(x.plotSubtree(A,G)&&G.exist&&G.drawn){var F=A.getAdjacency(G.id);!E&&x.onBeforePlotLine(F);D.globalAlpha=Math.min(w,G.getData("alpha"));B.plotLine(F,y,E);!E&&x.onAfterPlotLine(F);B.plotTree(G,x,E)}});if(A.drawn){!E&&x.onBeforePlotNode(A);this.plotNode(A,y,E);!E&&x.onAfterPlotNode(A);if(!x.hideLabels&&x.withLabels&&w>=0.95){this.labels.plotLabel(y,A,x)}else{this.labels.hideLabel(A,false)}}else{this.labels.hideLabel(A,true)}},plotNode:function(y,x,F){var C=y.getData("type"),B=this.node.CanvasStyles;if(C!="none"){var w=y.getData("lineWidth"),A=y.getData("color"),z=y.getData("alpha"),D=x.getCtx();D.lineWidth=w;D.fillStyle=D.strokeStyle=A;D.globalAlpha=z;for(var E in B){D[E]=y.getCanvasStyle(E)}this.nodeTypes[C].render.call(this,y,x,F)}},plotLine:function(B,x,E){var A=B.getData("type"),z=this.edge.CanvasStyles;if(A!="none"){var w=B.getData("lineWidth"),y=B.getData("color"),C=x.getCtx();C.lineWidth=w;C.fillStyle=C.strokeStyle=y;for(var D in z){C[D]=B.getCanvasStyle(D)}this.edgeTypes[A].render.call(this,B,x,E)}}};e.Label={};e.Label.Native=new q({plotLabel:function(y,z,x){var w=y.getCtx();var A=z.pos.getc(true);w.font=z.getLabelData("style")+" "+z.getLabelData("size")+"px "+z.getLabelData("family");w.textAlign=z.getLabelData("textAlign");w.fillStyle=w.strokeStyle=z.getLabelData("color");w.textBaseline=z.getLabelData("textBaseline");this.renderLabel(y,z,x)},renderLabel:function(y,z,x){var w=y.getCtx();var A=z.pos.getc(true);w.fillText(z.name,A.x,A.y+z.getData("height")/2)},hideLabel:c.empty,hideLabels:c.empty});e.Label.DOM=new q({labelsHidden:false,labelContainer:false,labels:{},getLabelContainer:function(){return this.labelContainer?this.labelContainer:this.labelContainer=document.getElementById(this.viz.config.labelContainer)},getLabel:function(w){return(w in this.labels&&this.labels[w]!=null)?this.labels[w]:this.labels[w]=document.getElementById(w)},hideLabels:function(x){var w=this.getLabelContainer();if(x){w.style.display="none"}else{w.style.display=""}this.labelsHidden=x},clearLabels:function(w){for(var x in this.labels){if(w||!this.viz.graph.hasNode(x)){this.disposeLabel(x);delete this.labels[x]}}},disposeLabel:function(x){var w=this.getLabel(x);if(w&&w.parentNode){w.parentNode.removeChild(w)}},hideLabel:function(A,w){A=c.splat(A);var x=w?"":"none",y,z=this;c.each(A,function(C){var B=z.getLabel(C.id);if(B){B.style.display=x}})},fitsInCanvas:function(y,w){var x=w.getSize();if(y.x>=x.width||y.x<0||y.y>=x.height||y.y<0){return false}return true}});e.Label.HTML=new q({Implements:e.Label.DOM,plotLabel:function(z,A,y){var B=A.id,w=this.getLabel(B);if(!w&&!(w=document.getElementById(B))){w=document.createElement("div");var x=this.getLabelContainer();w.id=B;w.className="node";w.style.position="absolute";y.onCreateLabel(w,A);x.appendChild(w);this.labels[A.id]=w}this.placeLabel(w,A,y)}});e.Label.SVG=new q({Implements:e.Label.DOM,plotLabel:function(z,B,y){var D=B.id,w=this.getLabel(D);if(!w&&!(w=document.getElementById(D))){var A="http://www.w3.org/2000/svg";w=document.createElementNS(A,"svg:text");var C=document.createElementNS(A,"svg:tspan");w.appendChild(C);var x=this.getLabelContainer();w.setAttribute("id",D);w.setAttribute("class","node");x.appendChild(w);y.onCreateLabel(w,B);this.labels[B.id]=w}this.placeLabel(w,B,y)}});e.Geom=new q({initialize:function(w){this.viz=w;this.config=w.config;this.node=w.config.Node;this.edge=w.config.Edge},translate:function(x,w){w=c.splat(w);this.viz.graph.eachNode(function(y){c.each(w,function(z){y.getPos(z).$add(x)})})},setRightLevelToShow:function(z,w,B){var A=this.getRightLevelToShow(z,w),y=this.viz.labels,x=c.merge({execShow:true,execHide:true,onHide:c.empty,onShow:c.empty},B||{});z.eachLevel(0,this.config.levelsToShow,function(D){var C=D._depth-z._depth;if(C>A){x.onHide(D);if(x.execHide){D.drawn=false;D.exist=false;y.hideLabel(D,false)}}else{x.onShow(D);if(x.execShow){D.exist=true}}});z.drawn=true},getRightLevelToShow:function(z,x){var w=this.config;var A=w.levelsToShow;var y=w.constrained;if(!y){return A}while(!this.treeFitsInCanvas(z,x,A)&&A>1){A--}return A}});var d={construct:function(x){var y=(c.type(x)=="array");var w=new e(this.graphOptions,this.config.Node,this.config.Edge,this.config.Label);if(!y){(function(z,B){z.addNode(B);if(B.children){for(var A=0,C=B.children;AC?F:C;D.setData("width",E);D.setData("height",E);D.setData("dim",E)}}})},initializeLabel:function(w){if(!this.label){this.label=document.createElement("div");document.body.appendChild(this.label)}this.setLabelStyles(w)},setLabelStyles:function(w){c.extend(this.label.style,{visibility:"hidden",position:"absolute",width:"auto",height:"auto"});this.label.className="jit-autoadjust-label"}};g.Tree=(function(){var F=Array.prototype.slice;function D(P,K,H,N,I){var M=K.Node;var J=K.multitree;if(M.overridable){var O=-1,L=-1;P.eachNode(function(S){if(S._depth==H&&(!J||("$orn" in S.data)&&S.data.$orn==N)){var Q=S.getData("width",I);var R=S.getData("height",I);O=(O0)?E[0]:null;D(E)}for(var z=0,A=[C.id].concat(x);z=D._depth)});for(var B=0;B0&&J.drawn){J.drawn=false;x[A.id].push(J)}else{if((!E||!D)&&J.drawn){J.drawn=false;x[A.id].push(J)}}});A.drawn=true}if(w.length>0){F.fx.plot()}for(B in x){c.each(x[B],function(J){J.drawn=true})}for(B=0;Bw?y:w)+this.config.subtreeOffset},getEdge:function(C,B,A){var y=function(E,w){return function(){return C.pos.add(new p(E,w))}};var D=this.node;var x=C.getData("width");var z=C.getData("height");if(B=="begin"){if(D.align=="center"){return this.dispatch(A,y(0,z/2),y(-x/2,0),y(0,-z/2),y(x/2,0))}else{if(D.align=="left"){return this.dispatch(A,y(0,z),y(0,0),y(0,0),y(x,0))}else{if(D.align=="right"){return this.dispatch(A,y(0,0),y(-x,0),y(0,-z),y(0,0))}else{throw"align: not implemented"}}}}else{if(B=="end"){if(D.align=="center"){return this.dispatch(A,y(0,-z/2),y(x/2,0),y(0,z/2),y(-x/2,0))}else{if(D.align=="left"){return this.dispatch(A,y(0,0),y(x,0),y(0,z),y(0,0))}else{if(D.align=="right"){return this.dispatch(A,y(0,-z),y(0,0),y(0,0),y(-x,0))}else{throw"align: not implemented"}}}}}},getScaledTreePosition:function(B,D){var C=this.node;var x=B.getData("width");var A=B.getData("height");var z=(this.config.multitree&&("$orn" in B.data)&&B.data.$orn)||this.config.orientation;var y=function(E,w){return function(){return B.pos.add(new p(E,w)).$scale(1-D)}};if(C.align=="left"){return this.dispatch(z,y(0,A),y(0,0),y(0,0),y(x,0))}else{if(C.align=="center"){return this.dispatch(z,y(0,A/2),y(-x/2,0),y(0,-A/2),y(x/2,0))}else{if(C.align=="right"){return this.dispatch(z,y(0,0),y(-x,0),y(0,-A),y(0,0))}else{throw"align: not implemented"}}}},treeFitsInCanvas:function(B,w,C){var y=w.getSize();var z=(this.config.multitree&&("$orn" in B.data)&&B.data.$orn)||this.config.orientation;var x=this.dispatch(z,y.width,y.height);var A=this.getTreeBaseSize(B,C,function(E,D){return E===0||!D.anySubnode()});return(A=0){z.drawn=false;var D=x.getCtx();var B=C.geom.getScaledTreePosition(z,A);D.translate(B.x,B.y);D.scale(A,A)}this.plotTree(z,c.merge(w,{withLabels:true,hideLabels:!!A,plotSubtree:function(I,G){var F=y.multitree&&!("$orn" in z.data);var H=F&&z.getData("orns");return !F||H.indexOf(elem.getData("orn"))>-1}}),E);if(A>=0){z.drawn=true}},getAlignedPos:function(B,z,w){var y=this.node;var A,x;if(y.align=="center"){A={x:B.x-z/2,y:B.y-w/2}}else{if(y.align=="left"){x=this.config.orientation;if(x=="bottom"||x=="top"){A={x:B.x-z/2,y:B.y}}else{A={x:B.x,y:B.y-w/2}}}else{if(y.align=="right"){x=this.config.orientation;if(x=="bottom"||x=="top"){A={x:B.x-z/2,y:B.y-w}}else{A={x:B.x-z,y:B.y-w/2}}}else{throw"align: not implemented"}}}return A},getOrientation:function(w){var y=this.config;var x=y.orientation;if(y.multitree){var z=w.nodeFrom;var A=w.nodeTo;x=(("$orn" in z.data)&&z.data.$orn)||(("$orn" in A.data)&&A.data.$orn)}return x}});$jit.ST.Label={};$jit.ST.Label.Native=new q({Implements:e.Label.Native,renderLabel:function(y,z,x){var w=y.getCtx();var A=z.pos.getc(true);w.fillText(z.name,A.x,A.y)}});$jit.ST.Label.DOM=new q({Implements:e.Label.DOM,placeLabel:function(P,J,F){var B=J.pos.getc(true),O=this.viz.config,K=O.Node,x=this.viz.canvas,C=J.getData("width"),M=J.getData("height"),y=x.getSize(),G,N;var A=x.translateOffsetX,z=x.translateOffsetY,E=x.scaleOffsetX,D=x.scaleOffsetY,I=B.x*E+A,H=B.y*D+z;if(K.align=="center"){G={x:Math.round(I-C/2+y.width/2),y:Math.round(H-M/2+y.height/2)}}else{if(K.align=="left"){N=O.orientation;if(N=="bottom"||N=="top"){G={x:Math.round(I-C/2+y.width/2),y:Math.round(H+y.height/2)}}else{G={x:Math.round(I+y.width/2),y:Math.round(H-M/2+y.height/2)}}}else{if(K.align=="right"){N=O.orientation;if(N=="bottom"||N=="top"){G={x:Math.round(I-C/2+y.width/2),y:Math.round(H-M+y.height/2)}}else{G={x:Math.round(I-C+y.width/2),y:Math.round(H-M/2+y.height/2)}}}else{throw"align: not implemented"}}}var L=P.style;L.left=G.x+"px";L.top=G.y+"px";L.display=this.fitsInCanvas(G,x)?"":"none";F.onPlaceLabel(P,J)}});$jit.ST.Label.SVG=new q({Implements:[$jit.ST.Label.DOM,e.Label.SVG],initialize:function(w){this.viz=w}});$jit.ST.Label.HTML=new q({Implements:[$jit.ST.Label.DOM,e.Label.HTML],initialize:function(w){this.viz=w}});$jit.ST.Plot.NodeTypes=new q({none:{render:c.empty,contains:c.lambda(false)},circle:{render:function(x,w){var z=x.getData("dim"),A=this.getAlignedPos(x.pos.getc(true),z,z),y=z/2;this.nodeHelper.circle.render("fill",{x:A.x+y,y:A.y+y},y,w)},contains:function(w,A){var y=w.getData("dim"),z=this.getAlignedPos(w.pos.getc(true),y,y),x=y/2;this.nodeHelper.circle.contains({x:z.x+x,y:z.y+x},x)}},square:{render:function(x,w){var z=x.getData("dim"),y=z/2,A=this.getAlignedPos(x.pos.getc(true),z,z);this.nodeHelper.square.render("fill",{x:A.x+y,y:A.y+y},y,w)},contains:function(w,A){var y=w.getData("dim"),z=this.getAlignedPos(w.pos.getc(true),y,y),x=y/2;this.nodeHelper.square.contains({x:z.x+x,y:z.y+x},x)}},ellipse:{render:function(z,x){var y=z.getData("width"),w=z.getData("height"),A=this.getAlignedPos(z.pos.getc(true),y,w);this.nodeHelper.ellipse.render("fill",{x:A.x+y/2,y:A.y+w/2},y,w,x)},contains:function(y,A){var x=y.getData("width"),w=y.getData("height"),z=this.getAlignedPos(y.pos.getc(true),x,w);this.nodeHelper.ellipse.contains({x:z.x+x/2,y:z.y+w/2},x,w,canvas)}},rectangle:{render:function(z,x){var y=z.getData("width"),w=z.getData("height"),A=this.getAlignedPos(z.pos.getc(true),y,w);this.nodeHelper.rectangle.render("fill",{x:A.x+y/2,y:A.y+w/2},y,w,x)},contains:function(y,A){var x=y.getData("width"),w=y.getData("height"),z=this.getAlignedPos(y.pos.getc(true),x,w);this.nodeHelper.rectangle.contains({x:z.x+x/2,y:z.y+w/2},x,w,canvas)}}});$jit.ST.Plot.EdgeTypes=new q({none:c.empty,line:{render:function(x,z){var y=this.getOrientation(x),A=x.nodeFrom,B=x.nodeTo,w=A._depth1&&D[0]!=y.id);this.edgeHelper.arrow.render(E,F,A,z,x)},contains:function(x,D){var y=this.getOrientation(x),z=x.nodeFrom,A=x.nodeTo,w=z._depth0||F[ag][1]>0)){var Q=K+F[ag][0],O=E+F[ag][1],af=Math.atan((O-Q)/w),Y=55;var U=M.createLinearGradient(aa+w/2,Z-(Q+O)/2,aa+w/2+Y*Math.sin(af),Z-(Q+O)/2+Y*Math.cos(af));var P=c.rgbToHex(c.map(c.hexToRgb(I[ag%C].slice(1)),function(x){return(x*0.85)>>0}));U.addColorStop(0,I[ag%C]);U.addColorStop(1,P);M.fillStyle=U}M.beginPath();M.moveTo(aa,Z-K);M.lineTo(aa+w,Z-E);M.lineTo(aa+w,Z-E-F[ag][1]);M.lineTo(aa,Z-K-F[ag][0]);M.lineTo(aa,Z-K);M.fill();M.restore();if(H){var R=H.name==L[ag];var z=R?0.7:0.8;var P=c.rgbToHex(c.map(c.hexToRgb(I[ag%C].slice(1)),function(x){return(x*z)>>0}));M.strokeStyle=P;M.lineWidth=R?4:1;M.save();M.beginPath();if(H.index===0){M.moveTo(aa,Z-K);M.lineTo(aa,Z-K-F[ag][0])}else{M.moveTo(aa+w,Z-E);M.lineTo(aa+w,Z-E-F[ag][1])}M.stroke();M.restore()}K+=(F[ag][0]||0);E+=(F[ag][1]||0);if(F[ag][0]>0){W+=(B[ag][0]||0)}}if(S&&ad.type=="Native"){M.save();M.beginPath();M.fillStyle=M.strokeStyle=ad.color;M.font=ad.style+" "+ad.size+"px "+ad.family;M.textAlign="center";M.textBaseline="middle";if(N(V.name,ac,ab,V)){M.fillText(W,aa,Z-K-X.labelOffset-ad.size/2,w)}if(ah(V.name,ac,ab,V)){M.fillText(V.name,aa,Z+ad.size/2+X.labelOffset)}M.restore()}}},contains:function(C,E){var J=C.pos.getc(true),z=C.getData("width"),N=C.getData("height"),M=this.getAlignedPos(J,z,N),L=M.x,K=M.y,O=C.getData("dimArray"),w=E.x-L;if(E.xL+z||E.y>K||E.y=G){var H=+(w>z/2);return{name:C.getData("stringArray")[F],color:C.getData("colorArray")[F],value:C.getData("valueArray")[F][H],index:H}}}return false}}});$jit.AreaChart=new q({st:null,colors:["#416D9C","#70A35E","#EBB056","#C74243","#83548B","#909291","#557EAA"],selected:{},busy:false,initialize:function(y){this.controller=this.config=c.merge(n("Canvas","Margin","Label","AreaChart"),{Label:{type:"Native"}},y);var z=this.config.showLabels,x=c.type(z),A=this.config.showAggregates,w=c.type(A);this.config.showLabels=x=="function"?z:c.lambda(z);this.config.showAggregates=w=="function"?A:c.lambda(A);this.initializeViz()},initializeViz:function(){var y=this.config,B=this,w=y.type.split(":")[0],A={};var x=new $jit.ST({injectInto:y.injectInto,orientation:"bottom",levelDistance:0,siblingOffset:0,subtreeOffset:0,withLabels:y.Label.type!="Native",useCanvas:y.useCanvas,Label:{type:y.Label.type},Node:{overridable:true,type:"areachart-"+w,align:"left",width:1,height:1},Edge:{type:"none"},Tips:{enable:y.Tips.enable,type:"Native",force:true,onShow:function(G,F,D){var E=D;y.Tips.onShow(G,E,F)}},Events:{enable:true,type:"Native",onClick:function(F,G,D){if(!y.filterOnClick&&!y.Events.enable){return}var E=G.getContains();if(E){y.filterOnClick&&B.filter(E.name)}y.Events.enable&&y.Events.onClick(E,G,D)},onRightClick:function(E,F,D){if(!y.restoreOnRightClick){return}B.restore()},onMouseMove:function(F,G,D){if(!y.selectOnHover){return}if(F){var E=G.getContains();B.select(F.id,E.name,E.index)}else{B.select(false,false,false)}}},onCreateLabel:function(J,G){var P=y.Label,O=G.getData("valueArray"),H=c.reduce(O,function(Q,R){return Q+R[0]},0),M=c.reduce(O,function(Q,R){return Q+R[1]},0);if(G.getData("prev")){var L={wrapper:document.createElement("div"),aggregate:document.createElement("div"),label:document.createElement("div")};var D=L.wrapper,N=L.label,E=L.aggregate,F=D.style,K=N.style,I=E.style;A[G.id]=L;D.appendChild(N);D.appendChild(E);if(!y.showLabels(G.name,H,M,G)){N.style.display="none"}if(!y.showAggregates(G.name,H,M,G)){E.style.display="none"}F.position="relative";F.overflow="visible";F.fontSize=P.size+"px";F.fontFamily=P.family;F.color=P.color;F.textAlign="center";I.position=K.position="absolute";J.style.width=G.getData("width")+"px";J.style.height=G.getData("height")+"px";N.innerHTML=G.name;J.appendChild(D)}},onPlaceLabel:function(U,O){if(!O.getData("prev")){return}var S=A[O.id],E=S.wrapper.style,D=S.label.style,N=S.aggregate.style,L=O.getData("width"),J=O.getData("height"),I=O.getData("dimArray"),F=O.getData("valueArray"),K=c.reduce(F,function(V,W){return V+W[0]},0),G=c.reduce(F,function(V,W){return V+W[1]},0),H=parseInt(E.fontSize,10),M=U.style;if(I&&F){if(y.showLabels(O.name,K,G,O)){D.display=""}else{D.display="none"}if(y.showAggregates(O.name,K,G,O)){N.display=""}else{N.display="none"}E.width=N.width=D.width=U.style.width=L+"px";N.left=D.left=-L/2+"px";for(var R=0,P=F.length,Q=0,T=0;R0){Q+=F[R][0];T+=I[R][0]}}N.top=(-H-y.labelOffset)+"px";D.top=(y.labelOffset+T)+"px";U.style.top=parseInt(U.style.top,10)-T+"px";U.style.height=E.height=T+"px";S.aggregate.innerHTML=Q}}});var z=x.canvas.getSize(),C=y.Margin;x.config.offsetY=-z.height/2+C.bottom+(y.showLabels&&(y.labelOffset+y.Label.size));x.config.offsetX=(C.right-C.left)/2;this.st=x;this.canvas=this.st.canvas},loadJSON:function(N){var K=c.time(),B=[],G=this.st,Q=c.splat(N.label),J=c.splat(N.color||this.colors),O=this.config,x=!!O.type.split(":")[1],z=O.animate;for(var L=0,y=N.values,I=y.length;L-1)?E:[0,0]}),"end")});this.st.fx.animate({modes:["node-property:dimArray"],duration:1500,onComplete:function(){y.busy=false}})},restore:function(){if(this.busy){return}this.busy=true;if(this.config.Tips.enable){this.st.tips.hide()}this.select(false,false,false);this.normalizeDims();var w=this;this.st.fx.animate({modes:["node-property:height:dimArray"],duration:1500,onComplete:function(){w.busy=false}})},select:function(B,x,w){if(!this.config.selectOnHover){return}var y=this.selected;if(y.id!=B||y.name!=x||y.index!=w){y.id=B;y.name=x;y.index=w;this.st.graph.eachNode(function(C){C.setData("border",false)});if(B){var A=this.st.graph.getNode(B);A.setData("border",y);var z=w===0?"prev":"next";z=A.getData(z);if(z){A=this.st.graph.getByName(z);if(A){A.setData("border",{name:x,index:1-w})}}}this.st.plot()}},getLegend:function(){var y={};var z;this.st.graph.getNode(this.st.root).eachAdjacency(function(A){z=A.nodeTo});var x=z.getData("colorArray"),w=x.length;c.each(z.getData("stringArray"),function(B,A){y[B]=x[A%w]});return y},getMaxValue:function(){var w=0;this.st.graph.eachNode(function(B){var y=B.getData("valueArray"),x=0,A=0;c.each(y,function(C){x+=+C[0];A+=+C[1]});var z=A>x?A:x;w=w>z?w:z});return w},normalizeDims:function(){var C=this.st.graph.getNode(this.st.root),z=0;C.eachAdjacency(function(){z++});var B=this.getMaxValue()||1,F=this.st.canvas.getSize(),y=this.config,A=y.Margin,D=y.labelOffset+y.Label.size,w=(F.width-(A.left+A.right))/z,x=y.animate,E=F.height-(A.top+A.bottom)-(y.showAggregates&&D)-(y.showLabels&&D);this.st.graph.eachNode(function(L){var I=0,K=0,G=[];c.each(L.getData("valueArray"),function(M){I+=+M[0];K+=+M[1];G.push([0,0])});var J=K>I?K:I;L.setData("width",w);if(x){L.setData("height",J*E/B,"end");L.setData("dimArray",c.map(L.getData("valueArray"),function(M){return[M[0]*E/B,M[1]*E/B]}),"end");var H=L.getData("dimArray");if(!H){L.setData("dimArray",G)}}else{L.setData("height",J*E/B);L.setData("dimArray",c.map(L.getData("valueArray"),function(M){return[M[0]*E/B,M[1]*E/B]}))}})}});n.BarChart={$extend:true,animate:true,type:"stacked",labelOffset:3,barsOffset:0,hoveredColor:"#9fd4ff",orientation:"horizontal",showAggregates:true,showLabels:true,Tips:{enable:false,onShow:c.empty,onHide:c.empty},Events:{enable:false,onClick:c.empty}};$jit.ST.Plot.NodeTypes.implement({"barchart-stacked":{render:function(Q,C){var H=Q.pos.getc(true),P=Q.getData("width"),N=Q.getData("height"),L=this.getAlignedPos(H,P,N),K=L.x,J=L.y,M=Q.getData("dimArray"),F=Q.getData("valueArray"),E=Q.getData("colorArray"),B=E.length,X=Q.getData("stringArray");var S=C.getCtx(),w={},T=Q.getData("border"),z=Q.getData("gradient"),Z=Q.getData("config"),A=Z.orientation=="horizontal",D=Z.showAggregates,O=Z.showLabels,I=Z.Label;if(E&&M&&X){for(var W=0,R=M.length,V=0,G=0;W>0}));Y.addColorStop(0,U);Y.addColorStop(0.5,E[W%B]);Y.addColorStop(1,U);S.fillStyle=Y}if(A){S.fillRect(K+V,J,M[W],N)}else{S.fillRect(K,J-V-M[W],P,M[W])}if(T&&T.name==X[W]){w.acum=V;w.dimValue=M[W]}V+=(M[W]||0);G+=(F[W]||0)}if(T){S.save();S.lineWidth=2;S.strokeStyle=T.color;if(A){S.strokeRect(K+w.acum+1,J+1,w.dimValue-2,N-2)}else{S.strokeRect(K+1,J-w.acum-w.dimValue+1,P-2,w.dimValue-2)}S.restore()}if(I.type=="Native"){S.save();S.fillStyle=S.strokeStyle=I.color;S.font=I.style+" "+I.size+"px "+I.family;S.textBaseline="middle";if(D(Q.name,G)){if(A){S.textAlign="right";S.fillText(G,K+V-Z.labelOffset,J+N/2)}else{S.textAlign="center";S.fillText(G,K+P/2,J-N-I.size/2-Z.labelOffset)}}if(O(Q.name,G,Q)){if(A){S.textAlign="center";S.translate(K-Z.labelOffset-I.size/2,J+N/2);S.rotate(Math.PI/2);S.fillText(Q.name,0,0)}else{S.textAlign="center";S.fillText(Q.name,K+P/2,J+I.size/2+Z.labelOffset)}}S.restore()}}},contains:function(D,F){var I=D.pos.getc(true),A=D.getData("width"),N=D.getData("height"),M=this.getAlignedPos(I,A,N),L=M.x,J=M.y,O=D.getData("dimArray"),B=D.getData("config"),z=F.x-L,w=B.orientation=="horizontal";if(w){if(F.xL+A||F.y>J+N||F.yL+A||F.y>J||F.y=H){return{name:D.getData("stringArray")[G],color:D.getData("colorArray")[G],value:D.getData("valueArray")[G],label:D.name}}}}return false}},"barchart-grouped":{render:function(R,C){var I=R.pos.getc(true),Q=R.getData("width"),O=R.getData("height"),M=this.getAlignedPos(I,Q,O),L=M.x,K=M.y,N=R.getData("dimArray"),G=R.getData("valueArray"),X=G.length,F=R.getData("colorArray"),B=F.length,Z=R.getData("stringArray");var T=C.getCtx(),w={},U=R.getData("border"),z=R.getData("gradient"),ab=R.getData("config"),A=ab.orientation=="horizontal",E=ab.showAggregates,P=ab.showLabels,J=ab.Label,D=(A?O:Q)/X;if(F&&N&&Z){for(var Y=0,S=X,W=0,H=0;Y>0}));aa.addColorStop(0,V);aa.addColorStop(0.5,F[Y%B]);aa.addColorStop(1,V);T.fillStyle=aa}if(A){T.fillRect(L,K+D*Y,N[Y],D)}else{T.fillRect(L+D*Y,K-N[Y],D,N[Y])}if(U&&U.name==Z[Y]){w.acum=D*Y;w.dimValue=N[Y]}W+=(N[Y]||0);H+=(G[Y]||0)}if(U){T.save();T.lineWidth=2;T.strokeStyle=U.color;if(A){T.strokeRect(L+1,K+w.acum+1,w.dimValue-2,D-2)}else{T.strokeRect(L+w.acum+1,K-w.dimValue+1,D-2,w.dimValue-2)}T.restore()}if(J.type=="Native"){T.save();T.fillStyle=T.strokeStyle=J.color;T.font=J.style+" "+J.size+"px "+J.family;T.textBaseline="middle";if(E(R.name,H)){if(A){T.textAlign="right";T.fillText(H,L+Math.max.apply(null,N)-ab.labelOffset,K+O/2)}else{T.textAlign="center";T.fillText(H,L+Q/2,K-Math.max.apply(null,N)-J.size/2-ab.labelOffset)}}if(P(R.name,H,R)){if(A){T.textAlign="center";T.translate(L-ab.labelOffset-J.size/2,K+O/2);T.rotate(Math.PI/2);T.fillText(R.name,0,0)}else{T.textAlign="center";T.fillText(R.name,L+Q/2,K+J.size/2+ab.labelOffset)}}T.restore()}}},contains:function(J,F){var B=J.pos.getc(true),I=J.getData("width"),H=J.getData("height"),E=this.getAlignedPos(B,I,H),D=E.x,C=E.y,G=J.getData("dimArray"),M=G.length,P=J.getData("config"),A=F.x-D,w=P.orientation=="horizontal",z=(w?H:I)/M;if(w){if(F.xD+I||F.y>C+H||F.yD+I||F.y>C||F.y=N&&F.y<=N+z){return{name:J.getData("stringArray")[L],color:J.getData("colorArray")[L],value:J.getData("valueArray")[L],label:J.name}}}else{var N=D+z*L;if(F.x>=N&&F.x<=N+z&&F.y>=C-O){return{name:J.getData("stringArray")[L],color:J.getData("colorArray")[L],value:J.getData("valueArray")[L],label:J.name}}}}return false}}});$jit.BarChart=new q({st:null,colors:["#416D9C","#70A35E","#EBB056","#C74243","#83548B","#909291","#557EAA"],selected:{},busy:false,initialize:function(y){this.controller=this.config=c.merge(n("Canvas","Margin","Label","BarChart"),{Label:{type:"Native"}},y);var z=this.config.showLabels,x=c.type(z),A=this.config.showAggregates,w=c.type(A);this.config.showLabels=x=="function"?z:c.lambda(z);this.config.showAggregates=w=="function"?A:c.lambda(A);this.initializeViz()},initializeViz:function(){var y=this.config,B=this;var w=y.type.split(":")[0],D=y.orientation=="horizontal",A={};var x=new $jit.ST({injectInto:y.injectInto,orientation:D?"left":"bottom",levelDistance:0,siblingOffset:y.barsOffset,subtreeOffset:0,withLabels:y.Label.type!="Native",useCanvas:y.useCanvas,Label:{type:y.Label.type},Node:{overridable:true,type:"barchart-"+w,align:"left",width:1,height:1},Edge:{type:"none"},Tips:{enable:y.Tips.enable,type:"Native",force:true,onShow:function(H,G,E){var F=E;y.Tips.onShow(H,F,G)}},Events:{enable:true,type:"Native",onClick:function(G,H,E){if(!y.Events.enable){return}var F=H.getContains();y.Events.onClick(F,H,E)},onMouseMove:function(G,H,E){if(!y.hoveredColor){return}if(G){var F=H.getContains();B.select(G.id,F.name,F.index)}else{B.select(false,false,false)}}},onCreateLabel:function(J,H){var P=y.Label,N=H.getData("valueArray"),M=c.reduce(N,function(Q,R){return Q+R},0);var L={wrapper:document.createElement("div"),aggregate:document.createElement("div"),label:document.createElement("div")};var E=L.wrapper,O=L.label,F=L.aggregate,G=E.style,K=O.style,I=F.style;A[H.id]=L;E.appendChild(O);E.appendChild(F);if(!y.showLabels(H.name,M,H)){K.display="none"}if(!y.showAggregates(H.name,M,H)){I.display="none"}G.position="relative";G.overflow="visible";G.fontSize=P.size+"px";G.fontFamily=P.family;G.color=P.color;G.textAlign="center";I.position=K.position="absolute";J.style.width=H.getData("width")+"px";J.style.height=H.getData("height")+"px";I.left=K.left="0px";O.innerHTML=H.name;J.appendChild(E)},onPlaceLabel:function(L,H){if(!A[H.id]){return}var N=A[H.id],I=N.wrapper.style,P=N.label.style,M=N.aggregate.style,Q=y.type.split(":")[0]=="grouped",E=y.orientation=="horizontal",T=H.getData("dimArray"),U=H.getData("valueArray"),F=(Q&&E)?Math.max.apply(null,T):H.getData("width"),S=(Q&&!E)?Math.max.apply(null,T):H.getData("height"),G=parseInt(I.fontSize,10),O=L.style;if(T&&U){I.width=M.width=P.width=L.style.width=F+"px";for(var K=0,J=U.length,R=0;K0){R+=U[K]}}if(y.showLabels(H.name,R,H)){P.display=""}else{P.display="none"}if(y.showAggregates(H.name,R,H)){M.display=""}else{M.display="none"}if(y.orientation=="horizontal"){M.textAlign="right";P.textAlign="left";P.textIndex=M.textIndent=y.labelOffset+"px";M.top=P.top=(S-G)/2+"px";L.style.height=I.height=S+"px"}else{M.top=(-G-y.labelOffset)+"px";P.top=(y.labelOffset+S)+"px";L.style.top=parseInt(L.style.top,10)-S+"px";L.style.height=I.height=S+"px"}N.aggregate.innerHTML=R}}});var z=x.canvas.getSize(),C=y.Margin;if(D){x.config.offsetX=z.width/2-C.left-(y.showLabels&&(y.labelOffset+y.Label.size));x.config.offsetY=(C.bottom-C.top)/2}else{x.config.offsetY=-z.height/2+C.bottom+(y.showLabels&&(y.labelOffset+y.Label.size));x.config.offsetX=(C.right-C.left)/2}this.st=x;this.canvas=this.st.canvas},loadJSON:function(K){if(this.busy){return}this.busy=true;var I=c.time(),C=[],D=this.st,N=c.splat(K.label),H=c.splat(K.color||this.colors),L=this.config,w=!!L.type.split(":")[1],z=L.animate,y=L.orientation=="horizontal",A=this;for(var J=0,x=K.values,F=x.length;Jz?x:z});return x},setBarType:function(w){this.config.type=w;this.st.config.Node.type="barchart-"+w.split(":")[0]},normalizeDims:function(){var G=this.st.graph.getNode(this.st.root),B=0;G.eachAdjacency(function(){B++});var D=this.getMaxValue()||1,J=this.st.canvas.getSize(),z=this.config,C=z.Margin,H=C.left+C.right,A=C.top+C.bottom,x=z.orientation=="horizontal",w=(J[x?"height":"width"]-(x?A:H)-(B-1)*z.barsOffset)/B,y=z.animate,I=J[x?"width":"height"]-(x?H:A)-(!x&&z.showAggregates&&(z.Label.size+z.labelOffset))-(z.showLabels&&(z.Label.size+z.labelOffset)),F=x?"height":"width",E=x?"width":"height";this.st.graph.eachNode(function(N){var M=0,K=[];c.each(N.getData("valueArray"),function(O){M+=+O;K.push(0)});N.setData(F,w);if(y){N.setData(E,M*I/D,"end");N.setData("dimArray",c.map(N.getData("valueArray"),function(O){return O*I/D}),"end");var L=N.getData("dimArray");if(!L){N.setData("dimArray",K)}}else{N.setData(E,M*I/D);N.setData("dimArray",c.map(N.getData("valueArray"),function(O){return O*I/D}))}})}});n.PieChart={$extend:true,animate:true,offset:25,sliceOffset:0,labelOffset:3,type:"stacked",hoveredColor:"#9fd4ff",Events:{enable:false,onClick:c.empty},Tips:{enable:false,onShow:c.empty,onHide:c.empty},showLabels:true,resizeLabels:false,updateHeights:false};g.Radial=new q({compute:function(x){var y=c.splat(x||["current","start","end"]);f.compute(this.graph,y,this.config);this.graph.computeLevels(this.root,0,"ignore");var w=this.createLevelDistanceFunc();this.computeAngularWidths(y);this.computePositions(y,w)},computePositions:function(D,A){var F=D;var E=this.graph;var B=E.getNode(this.root);var C=this.parent;var w=this.config;for(var y=0,x=F.length;yJ[Z]?Y:J[Z]):Y}G.push(W)},"ignore");if(C&&C.id==K.id&&G.length>0&&G[0].dist){G.sort(function(W,V){return(W.dist>=V.dist)-(W.dist<=V.dist)})}for(var M=0,O=G.length;MF/2&&B.theta<3*F/2);var L=I?B.theta+F:B.theta;if(I){M-=Math.abs(Math.cos(B.theta)*A.width);K+=Math.sin(B.theta)*A.width}else{if(E.id==this.viz.root){M-=A.width/2}}}O.save();O.translate(M,K);O.rotate(L);O.fillText(E.name,0,0);O.restore()}});w.Label.SVG=new q({Implements:e.Label.SVG,initialize:function(x){this.viz=x},placeLabel:function(N,C,E){var J=C.pos.getc(true),M=this.viz,A=this.viz.canvas;var F=A.getSize();var B={x:Math.round(J.x+F.width/2),y:Math.round(J.y+F.height/2)};N.setAttribute("x",B.x);N.setAttribute("y",B.y);var G=N.getBBox();if(G){var L=N.getAttribute("x");var I=N.getAttribute("y");var z=C.pos.getp(true);var D=Math.PI;var H=(z.theta>D/2&&z.theta<3*D/2);if(H){N.setAttribute("x",L-G.width);N.setAttribute("y",I-G.height)}else{if(C.id==M.root){N.setAttribute("x",L-G.width/2)}}var K=H?z.theta+D:z.theta;if(C._depth){N.setAttribute("transform","rotate("+K*360/(2*D)+" "+L+" "+I+")")}}E.onPlaceLabel(N,C)}});w.Label.HTML=new q({Implements:e.Label.HTML,initialize:function(x){this.viz=x},placeLabel:function(G,A,C){var E=A.pos.clone(),y=this.viz.canvas,F=A.getData("height"),B=((F||A._depth==0)?F:this.viz.config.levelDistance)/2,D=y.getSize();E.rho+=B;E=E.getc(true);var z={x:Math.round(E.x+D.width/2),y:Math.round(E.y+D.height/2)};var x=G.style;x.left=z.x+"px";x.top=z.y+"px";x.display=this.fitsInCanvas(z,y)?"":"none";C.onPlaceLabel(G,A)}});w.Plot.NodeTypes=new q({none:{render:c.empty,contains:c.lambda(false),anglecontains:function(B,D){var A=B.getData("span")/2,y=B.pos.theta;var z=y-A,x=y+A;if(z<0){z+=Math.PI*2}var C=Math.atan2(D.y,D.x);if(C<0){C+=Math.PI*2}if(z>x){return(C>z&&C<=Math.PI*2)||Cz&&C=z*C)&&(y<=(z*C+B))}return false}},"gradient-multipie":{render:function(A,x){var F=x.getCtx();var E=A.getData("height");var B=E?E:this.config.levelDistance;var y=F.createRadialGradient(0,0,A.getPos().rho,0,0,A.getPos().rho+B);var D=c.hexToRgb(A.getData("color")),C=[];c.each(D,function(G){C.push(parseInt(G*0.5,10))});var z=c.rgbToHex(C);y.addColorStop(0,z);y.addColorStop(1,A.getData("color"));F.fillStyle=y;this.nodeTypes.multipie.render.call(this,A,x)},contains:function(x,y){return this.nodeTypes.multipie.contains.call(this,x,y)}},"gradient-pie":{render:function(C,z){var x=z.getCtx();var D=x.createRadialGradient(0,0,0,0,0,C.getPos().rho);var B=c.hexToRgb(C.getData("color")),y=[];c.each(B,function(E){y.push(parseInt(E*0.5,10))});var A=c.rgbToHex(y);D.addColorStop(1,A);D.addColorStop(0,C.getData("color"));x.fillStyle=D;this.nodeTypes.pie.render.call(this,C,z)},contains:function(x,y){return this.nodeTypes.pie.contains.call(this,x,y)}}});w.Plot.EdgeTypes=new q({none:c.empty,line:{render:function(x,y){var A=x.nodeFrom.pos.getc(true),z=x.nodeTo.pos.getc(true);this.edgeHelper.line.render(A,z,y)},contains:function(x,A){var z=x.nodeFrom.pos.getc(true),y=x.nodeTo.pos.getc(true);return this.edgeHelper.line.contains(z,y,A,this.edge.epsilon)}},arrow:{render:function(y,z){var D=y.nodeFrom.pos.getc(true),C=y.nodeTo.pos.getc(true),B=y.getData("dim"),A=y.data.$direction,x=(A&&A.length>1&&A[0]!=y.nodeFrom.id);this.edgeHelper.arrow.render(D,C,B,x,z)},contains:function(x,A){var z=x.nodeFrom.pos.getc(true),y=x.nodeTo.pos.getc(true);return this.edgeHelper.arrow.contains(z,y,A,this.edge.epsilon)}},hyperline:{render:function(x,y){var B=x.nodeFrom.pos.getc(),A=x.nodeTo.pos.getc(),z=Math.max(B.norm(),A.norm());this.edgeHelper.hyperline.render(B.$scale(1/z),A.$scale(1/z),z,y)},contains:c.lambda(false)}})})($jit.Sunburst);$jit.Sunburst.Plot.NodeTypes.implement({"piechart-stacked":{render:function(U,A){var T=U.pos.getp(true),C=U.getData("dimArray"),S=U.getData("valueArray"),G=U.getData("colorArray"),z=G.length,M=U.getData("stringArray"),P=U.getData("span")/2,K=U.pos.theta,F=K-P,J=K+P,R=new b;var N=A.getCtx(),L={},I=U.getData("gradient"),D=U.getData("border"),Z=U.getData("config"),ai=Z.showLabels,Y=Z.resizeLabels,ab=Z.Label;var ae=Z.sliceOffset*Math.cos((F+J)/2);var E=Z.sliceOffset*Math.sin((F+J)/2);if(G&&C&&M){for(var af=0,ac=C.length,w=0,X=0;af>0}),y=c.rgbToHex(W);ad.addColorStop(0,ag);ad.addColorStop(0.5,ag);ad.addColorStop(1,y);N.fillStyle=ad}R.rho=w+Z.sliceOffset;R.theta=F;var ah=R.getc(true);R.theta=J;var O=R.getc(true);R.rho+=B;var aj=R.getc(true);R.theta=F;var Q=R.getc(true);N.beginPath();N.arc(ae,E,w+0.01,F,J,false);N.arc(ae,E,w+B+0.01,J,F,true);N.fill();if(D&&D.name==M[af]){L.acum=w;L.dimValue=C[af];L.begin=F;L.end=J}w+=(B||0);X+=(S[af]||0)}if(D){N.save();N.globalCompositeOperation="source-over";N.lineWidth=2;N.strokeStyle=D.color;var aa=F>0;H=H<+Y?+Y:H;N.font=ab.style+" "+H+"px "+ab.family;N.textBaseline="middle";N.textAlign="center";R.rho=w+Z.labelOffset+Z.sliceOffset;R.theta=U.pos.theta;var ak=R.getc(true);N.fillText(U.name,ak.x,ak.y);N.restore()}}},contains:function(z,D){if(this.nodeTypes.none.anglecontains.call(this,z,D)){var F=Math.sqrt(D.x*D.x+D.y*D.y);var w=this.config.levelDistance,C=z._depth;var x=z.getData("config");if(F<=w*C+x.sliceOffset){var G=z.getData("dimArray");for(var B=0,A=G.length,E=x.sliceOffset;B=E&&F<=E+y){return{name:z.getData("stringArray")[B],color:z.getData("colorArray")[B],value:z.getData("valueArray")[B],label:z.name}}E+=y}}return false}return false}}});$jit.PieChart=new q({sb:null,colors:["#416D9C","#70A35E","#EBB056","#C74243","#83548B","#909291","#557EAA"],selected:{},busy:false,initialize:function(w){this.controller=this.config=c.merge(n("Canvas","PieChart","Label"),{Label:{type:"Native"}},w);this.initializeViz()},initializeViz:function(){var x=this.config,A=this;var w=x.type.split(":")[0];var B=new $jit.Sunburst({injectInto:x.injectInto,useCanvas:x.useCanvas,withLabels:x.Label.type!="Native",Label:{type:x.Label.type},Node:{overridable:true,type:"piechart-"+w,width:1,height:1},Edge:{type:"none"},Tips:{enable:x.Tips.enable,type:"Native",force:true,onShow:function(F,E,C){var D=C;x.Tips.onShow(F,D,E)}},Events:{enable:true,type:"Native",onClick:function(E,F,C){if(!x.Events.enable){return}var D=F.getContains();x.Events.onClick(D,F,C)},onMouseMove:function(E,F,C){if(!x.hoveredColor){return}if(E){var D=F.getContains();A.select(E.id,D.name,D.index)}else{A.select(false,false,false)}}},onCreateLabel:function(F,E){var C=x.Label;if(x.showLabels){var D=F.style;D.fontSize=C.size+"px";D.fontFamily=C.family;D.color=C.color;D.textAlign="center";F.innerHTML=E.name}},onPlaceLabel:function(S,M){if(!x.showLabels){return}var G=M.pos.getp(true),J=M.getData("dimArray"),P=M.getData("span")/2,H=M.pos.theta,R=H-P,D=H+P,U=new b;var L=x.showLabels,F=x.resizeLabels,I=x.Label;if(J){for(var Q=0,N=J.length,O=0;Q>0;C=C<+F?+F:C;S.style.fontSize=C+"px";U.rho=O+x.labelOffset+x.sliceOffset;U.theta=(R+D)/2;var G=U.getc(true);var E=A.canvas.getSize();var K={x:Math.round(G.x+E.width/2),y:Math.round(G.y+E.height/2)};S.style.left=K.x+"px";S.style.top=K.y+"px"}}});var z=B.canvas.getSize(),y=Math.min;B.config.levelDistance=y(z.width,z.height)/2-x.offset-x.sliceOffset;this.sb=B;this.canvas=this.sb.canvas;this.canvas.getCtx().globalCompositeOperation="lighter"},loadJSON:function(K){var I=c.time(),C=[],w=this.sb,N=c.splat(K.label),E=N.length,H=c.splat(K.color||this.colors),z=H.length,L=this.config,x=!!L.type.split(":")[1],A=L.animate,G=E==1;for(var J=0,y=K.values,F=y.length;Jy?w:y});return w},normalizeDims:function(){var x=this.sb.graph.getNode(this.sb.root),w=0;x.eachAdjacency(function(){w++});var B=this.getMaxValue()||1,A=this.config,y=A.animate,z=this.sb.config.levelDistance;this.sb.graph.eachNode(function(G){var F=0,C=[];c.each(G.getData("valueArray"),function(H){F+=+H;C.push(1)});var E=(C.length==1)&&!A.updateHeights;if(y){G.setData("dimArray",c.map(G.getData("valueArray"),function(H){return E?z:(H*z/B)}),"end");var D=G.getData("dimArray");if(!D){G.setData("dimArray",C)}}else{G.setData("dimArray",c.map(G.getData("valueArray"),function(H){return E?z:(H*z/B)}))}G.setData("normalizedDim",F/B)})}});g.TM={};g.TM.SliceAndDice=new q({compute:function(B){var x=this.graph.getNode(this.clickedNode&&this.clickedNode.id||this.root);this.controller.onBeforeCompute(x);var z=this.canvas.getSize(),y=this.config,A=z.width,w=z.height;this.graph.computeLevels(this.root,0,"ignore");x.getPos(B).setc(-A/2,-w/2);x.setData("width",A,B);x.setData("height",w+y.titleHeight,B);this.computePositions(x,x,this.layout.orientation,B);this.controller.onAfterCompute(x)},computePositions:function(F,D,P,y){var M=0;F.eachSubnode(function(R){M+=R.getData("area",y)});var Q=this.config,N=Q.offset,J=F.getData("width",y),H=F.getData("height",y)-Q.titleHeight,x=F==D?1:(D.getData("area",y)/M);var I,G,L,B,A,E,C;var O=(P=="h");if(O){P="v";I=H;G=J*x;L="height";B="y";A="x";E=Q.titleHeight;C=0}else{P="h";I=H*x;G=J;L="width";B="x";A="y";E=0;C=Q.titleHeight}var w=D.getPos(y);D.setData("width",G,y);D.setData("height",I,y);var K=0,z=this;D.eachSubnode(function(S){var R=S.getPos(y);R[B]=K+w[B]+E;R[A]=w[A]+C;z.computePositions(D,S,P,y);K+=S.getData(L,y)})}});g.TM.Area={compute:function(w){w=w||"current";var C=this.graph.getNode(this.clickedNode&&this.clickedNode.id||this.root);this.controller.onBeforeCompute(C);var y=this.config,F=this.canvas.getSize(),x=F.width,E=F.height,D=y.offset,z=x-D,B=E-D;this.graph.computeLevels(this.root,0,"ignore");C.getPos(w).setc(-x/2,-E/2);C.setData("width",x,w);C.setData("height",E,w);var A={top:-E/2+y.titleHeight,left:-x/2,width:z,height:B-y.titleHeight};this.computePositions(C,A,w);this.controller.onAfterCompute(C)},computeDim:function(B,C,E,A,z,x){if(B.length+C.length==1){var y=(B.length==1)?B:C;this.layoutLast(y,E,A,x);return}if(B.length>=2&&C.length==0){C=[B.shift()]}if(B.length==0){if(C.length>0){this.layoutRow(C,E,A,x)}return}var D=B[0];if(z(C,E)>=z([D].concat(C),E)){this.computeDim(B.slice(1),C.concat([D]),E,A,z,x)}else{var F=this.layoutRow(C,E,A,x);this.computeDim(B,[],F.dim,F,z,x)}},worstAspectRatio:function(x,F){if(!x||x.length==0){return Number.MAX_VALUE}var y=0,G=0,B=Number.MAX_VALUE;for(var D=0,C=x.length;Dz?G:z}var E=F*F,A=y*y;return Math.max(E*G/A,A/(E*B))},avgAspectRatio:function(B,y){if(!B||B.length==0){return Number.MAX_VALUE}var D=0;for(var z=0,x=B.length;zA?y/A:A/y}return D/x},layoutLast:function(y,x,B,A){var z=y[0];z.getPos(A).setc(B.left,B.top);z.setData("width",B.width,A);z.setData("height",B.height,A)}};g.TM.Squarified=new q({Implements:g.TM.Area,computePositions:function(A,D,x){var z=this.config;if(D.width>=D.height){this.layout.orientation="h"}else{this.layout.orientation="v"}var w=A.getSubnodes([1,1],"ignore");if(w.length>0){this.processChildrenLayout(A,w,D,x);for(var C=0,B=w.length;C0){this.processChildrenLayout(A,w,D,x);for(var C=0,B=w.length;CF){F=I}});var y=this.graph.getNode(this.clickedNode&&this.clickedNode.id||D.id);var x=Math.min(F,C-1);var B=y._depth;if(this.layout.horizontal()){this.computeSubtree(y,-w/2,-G/2,w/(x+1),G,B,x,E)}else{this.computeSubtree(y,-w/2,-G/2,w,G/(x+1),B,x,E)}},computeSubtree:function(G,I,F,w,L,E,A,H){G.getPos(H).setc(I,F);G.setData("width",w,H);G.setData("height",L,H);var C,K=0,J=0;var z=e.Util.getSubnodes(G,[1,1]);if(!z.length){return}c.each(z,function(x){J+=x.getData("dim")});for(var D=0,B=z.length;D>0}));I.addColorStop(0,A);I.addColorStop(1,E);J.fillStyle=I}if(B){J.strokeStyle=B;J.lineWidth=3}J.fillRect(F,D,Math.max(0,w-C),Math.max(0,H-C));B&&J.strokeRect(G.x,G.y,w,H)},contains:function(y,A){if(this.viz.clickedNode&&!$jit.Graph.Util.isDescendantOf(y,this.viz.clickedNode.id)){return false}var z=y.pos.getc(true),x=y.getData("width"),w=y.getData("height");return this.nodeHelper.rectangle.contains({x:z.x+x/2,y:z.y+w/2},A,x,w)}}});$jit.Icicle.Plot.EdgeTypes=new q({none:c.empty});g.ForceDirected=new q({getOptions:function(D){var B=this.canvas.getSize();var y=B.width,A=B.height;var C=0;this.graph.eachNode(function(w){C++});var E=y*A/C,z=Math.sqrt(E);var x=this.config.levelDistance;return{width:y,height:A,tstart:y*0.1,nodef:function(w){return E/(w||1)},edgef:function(w){return z*(w-x)}}},compute:function(x,y){var z=c.splat(x||["current","start","end"]);var w=this.getOptions();f.compute(this.graph,z,this.config);this.graph.computeLevels(this.root,0,"ignore");this.graph.eachNode(function(A){c.each(z,function(B){var C=A.getPos(B);if(C.equals(p.KER)){C.x=w.width/5*(Math.random()-0.5);C.y=w.height/5*(Math.random()-0.5)}A.disp={};c.each(z,function(D){A.disp[D]=r(0,0)})})});this.computePositions(z,w,y)},computePositions:function(A,y,B){var C=this.config.iterations,x=0,z=this;if(B){(function w(){for(var E=B.iter,D=0;D=C){B.onComplete();return}}B.onStep(Math.round(x/(C-1)*100));setTimeout(w,1)})()}else{for(;x1&&A[0]!=y.nodeFrom.id);this.edgeHelper.arrow.render(D,C,B,x,z)},contains:function(x,A){var z=x.nodeFrom.pos.getc(true),y=x.nodeTo.pos.getc(true);return this.edgeHelper.arrow.contains(z,y,A,this.edge.epsilon)}}})})($jit.ForceDirected);$jit.TM={};var v=$jit.TM;$jit.TM.$extend=true;v.Base={layout:{orientation:"h",vertical:function(){return this.orientation=="v"},horizontal:function(){return this.orientation=="h"},change:function(){this.orientation=this.vertical()?"h":"v"}},initialize:function(w){var x={orientation:"h",titleHeight:13,offset:2,levelsToShow:0,constrained:false,animate:false,Node:{type:"rectangle",overridable:true,width:3,height:3,color:"#444"},Label:{textAlign:"center",textBaseline:"top"},Edge:{type:"none"},duration:700,fps:45};this.controller=this.config=c.merge(n("Canvas","Node","Edge","Fx","Controller","Tips","NodeStyles","Events","Navigation","Label"),x,w);this.layout.orientation=this.config.orientation;var y=this.config;if(y.useCanvas){this.canvas=y.useCanvas;this.config.labelContainer=this.canvas.id+"-label"}else{if(y.background){y.background=c.merge({type:"Circles"},y.background)}this.canvas=new l(this,y);this.config.labelContainer=(typeof y.injectInto=="string"?y.injectInto:y.injectInto.id)+"-label"}this.graphOptions={complex:true,Node:{selected:false,exist:true,drawn:true}};this.graph=new e(this.graphOptions,this.config.Node,this.config.Edge);this.labels=new v.Label[y.Label.type](this);this.fx=new v.Plot(this);this.op=new v.Op(this);this.group=new v.Group(this);this.geom=new v.Geom(this);this.clickedNode=null;this.busy=false;this.initializeExtras()},refresh:function(){if(this.busy){return}this.busy=true;var x=this;if(this.config.animate){this.compute("end");this.config.levelsToShow>0&&this.geom.setRightLevelToShow(this.graph.getNode(this.clickedNode&&this.clickedNode.id||this.root));this.fx.animate(c.merge(this.config,{modes:["linear","node-property:width:height"],onComplete:function(){x.busy=false}}))}else{var w=this.config.Label.type;if(w!="Native"){var x=this;this.graph.eachNode(function(y){x.labels.hideLabel(y,false)})}this.busy=false;this.compute();this.config.levelsToShow>0&&this.geom.setRightLevelToShow(this.graph.getNode(this.clickedNode&&this.clickedNode.id||this.root));this.plot()}},plot:function(){this.fx.plot()},leaf:function(w){return w.getSubnodes([1,1],"ignore").length==0},enter:function(C){if(this.busy){return}this.busy=true;var y=this,x=this.config,A=this.graph,w=C,z=this.clickedNode;var B={onComplete:function(){if(x.levelsToShow>0){y.geom.setRightLevelToShow(C)}if(x.levelsToShow>0||x.request){y.compute()}if(x.animate){A.nodeList.setData("alpha",0,"end");C.eachSubgraph(function(D){D.setData("alpha",1,"end")},"ignore");y.fx.animate({duration:500,modes:["node-property:alpha"],onComplete:function(){y.clickedNode=w;y.compute("end");y.clickedNode=z;y.fx.animate({modes:["linear","node-property:width:height"],duration:1000,onComplete:function(){y.busy=false;y.clickedNode=w}})}})}else{y.busy=false;y.clickedNode=C;y.refresh()}}};if(x.request){this.requestNodes(w,B)}else{B.onComplete()}},out:function(){if(this.busy){return}this.busy=true;this.events.hoveredNode=false;var A=this,y=this.config,C=this.graph,x=C.getNode(this.clickedNode&&this.clickedNode.id||this.root).getParents(),z=x[0],w=z,B=this.clickedNode;if(!z){this.busy=false;return}callback={onComplete:function(){A.clickedNode=z;if(y.request){A.requestNodes(z,{onComplete:function(){A.compute();A.plot();A.busy=false}})}else{A.compute();A.plot();A.busy=false}}};if(y.levelsToShow>0){this.geom.setRightLevelToShow(z)}if(y.animate){this.clickedNode=w;this.compute("end");this.clickedNode=B;this.fx.animate({modes:["linear","node-property:width:height"],duration:1000,onComplete:function(){A.clickedNode=w;C.eachNode(function(D){D.setDataset(["current","end"],{alpha:[0,1]})},"ignore");B.eachSubgraph(function(D){D.setData("alpha",1)},"ignore");A.fx.animate({duration:500,modes:["node-property:alpha"],onComplete:function(){callback.onComplete()}})}})}else{callback.onComplete()}},requestNodes:function(y,z){var x=c.merge(this.controller,z),w=this.config.levelsToShow;if(x.request){var B=[],A=y._depth;y.eachLevel(0,w,function(D){var C=w-(D._depth-A);if(D.drawn&&!D.anySubnode()&&C>0){B.push(D);D._level=C}});this.group.requestNodes(B,x)}else{x.onComplete()}}};v.Op=new q({Implements:e.Op,initialize:function(w){this.viz=w}});v.Geom=new q({Implements:e.Geom,getRightLevelToShow:function(){return this.viz.config.levelsToShow},setRightLevelToShow:function(x){var y=this.getRightLevelToShow(),w=this.viz.labels;x.eachLevel(0,y+1,function(A){var z=A._depth-x._depth;if(z>y){A.drawn=false;A.exist=false;A.ignore=true;w.hideLabel(A,false)}else{A.drawn=true;A.exist=true;delete A.ignore}});x.drawn=true;delete x.ignore}});v.Group=new q({initialize:function(w){this.viz=w;this.canvas=w.canvas;this.config=w.config},requestNodes:function(B,A){var z=0,x=B.length,D={};var y=function(){A.onComplete()};var w=this.viz;if(x==0){y()}for(var C=0;C>0}));K.addColorStop(0,A);K.addColorStop(1,F);L.fillStyle=K}L.fillRect(G,E,w-I,J-I);if(B){L.save();L.strokeStyle=B;L.strokeRect(G,E,w-I,J-I);L.restore()}}else{if(C>0){L.fillRect(H.x+I/2,H.y+I/2,w-I,C-I);if(B){L.save();L.strokeStyle=B;L.strokeRect(H.x+I/2,H.y+I/2,w-I,J-I);L.restore()}}}},contains:function(z,B){if(this.viz.clickedNode&&!z.isDescendantOf(this.viz.clickedNode.id)||z.ignore){return false}var A=z.pos.getc(true),y=z.getData("width"),x=this.viz.leaf(z),w=x?z.getData("height"):this.config.titleHeight;return this.nodeHelper.rectangle.contains({x:A.x+y/2,y:A.y+w/2},B,y,w)}}});v.Plot.EdgeTypes=new q({none:c.empty});v.SliceAndDice=new q({Implements:[d,o,v.Base,g.TM.SliceAndDice]});v.Squarified=new q({Implements:[d,o,v.Base,g.TM.Squarified]});v.Strip=new q({Implements:[d,o,v.Base,g.TM.Strip]});$jit.RGraph=new q({Implements:[d,o,g.Radial],initialize:function(w){var x=$jit.RGraph;var y={interpolation:"linear",levelDistance:100};this.controller=this.config=c.merge(n("Canvas","Node","Edge","Fx","Controller","Tips","NodeStyles","Events","Navigation","Label"),y,w);var z=this.config;if(z.useCanvas){this.canvas=z.useCanvas;this.config.labelContainer=this.canvas.id+"-label"}else{if(z.background){z.background=c.merge({type:"Circles"},z.background)}this.canvas=new l(this,z);this.config.labelContainer=(typeof z.injectInto=="string"?z.injectInto:z.injectInto.id)+"-label"}this.graphOptions={complex:false,Node:{selected:false,exist:true,drawn:true}};this.graph=new e(this.graphOptions,this.config.Node,this.config.Edge);this.labels=new x.Label[z.Label.type](this);this.fx=new x.Plot(this,x);this.op=new x.Op(this);this.json=null;this.root=null;this.busy=false;this.parent=false;this.initializeExtras()},createLevelDistanceFunc:function(){var w=this.config.levelDistance;return function(x){return(x._depth+1)*w}},refresh:function(){this.compute();this.plot()},reposition:function(){this.compute("end")},plot:function(){this.fx.plot()},getNodeAndParentAngle:function(D){var y=false;var C=this.graph.getNode(D);var A=C.getParents();var z=(A.length>0)?A[0]:false;if(z){var w=z.pos.getc(),B=C.pos.getc();var x=w.add(B.scale(-1));y=Math.atan2(x.y,x.x);if(y<0){y+=2*Math.PI}}return{parent:z,theta:y}},tagChildren:function(A,C){if(A.angleSpan){var B=[];A.eachAdjacency(function(D){B.push(D.nodeTo)},"ignore");var w=B.length;for(var z=0;z1&&A[0]!=y.nodeFrom.id);this.edgeHelper.arrow.render(D,C,B,x,z)},contains:function(x,A){var z=x.nodeFrom.pos.getc(true),y=x.nodeTo.pos.getc(true);return this.edgeHelper.arrow.contains(z,y,A,this.edge.epsilon)}}})})($jit.RGraph);p.prototype.moebiusTransformation=function(y){var w=this.add(y);var x=y.$conjugate().$prod(this);x.x++;return w.$div(x)};e.Util.moebiusTransformation=function(y,A,z,x,w){this.eachNode(y,function(C){for(var B=0;B=2){return B(z-0.01)}}return B(0.75)},getRadius:function(){var w=this.config.radius;if(w!=="auto"){return w}var x=this.canvas.getSize();return Math.min(x.width,x.height)/2},refresh:function(w){if(w){this.reposition();this.graph.eachNode(function(x){x.startPos.rho=x.pos.rho=x.endPos.rho;x.startPos.theta=x.pos.theta=x.endPos.theta})}else{this.compute()}this.plot()},reposition:function(){this.compute("end");var w=this.graph.getNode(this.root).pos.getc().scale(-1);e.Util.moebiusTransformation(this.graph,[w],["end"],"end","ignore");this.graph.eachNode(function(x){if(x.ignore){x.endPos.rho=x.pos.rho;x.endPos.theta=x.pos.theta}})},plot:function(){this.fx.plot()},onClick:function(y,w){var x=this.graph.getNode(y).pos.getc(true);this.move(x,w)},move:function(A,y){var x=r(A.x,A.y);if(this.busy===false&&x.norm()<1){this.busy=true;var w=this.graph.getClosestNodeToPos(x),z=this;this.graph.computeLevels(w.id,0);this.controller.onBeforeCompute(w);y=c.merge({onComplete:c.empty},y||{});this.fx.animate(c.merge({modes:["moebius"],hideLabels:true},y,{onComplete:function(){z.busy=false;y.onComplete()}}),x)}}});$jit.Hypertree.$extend=true;(function(w){w.Op=new q({Implements:e.Op});w.Plot=new q({Implements:e.Plot});w.Label={};w.Label.Native=new q({Implements:e.Label.Native,initialize:function(x){this.viz=x},renderLabel:function(z,B,y){var x=z.getCtx();var C=B.pos.getc(true);var A=this.viz.getRadius();x.fillText(B.name,C.x*A,C.y*A)}});w.Label.SVG=new q({Implements:e.Label.SVG,initialize:function(x){this.viz=x},placeLabel:function(I,C,D){var G=C.pos.getc(true),z=this.viz.canvas,A=z.translateOffsetX,y=z.translateOffsetY,H=z.scaleOffsetX,F=z.scaleOffsetY,E=z.getSize(),x=this.viz.getRadius();var B={x:Math.round((G.x*H)*x+A+E.width/2),y:Math.round((G.y*F)*x+y+E.height/2)};I.setAttribute("x",B.x);I.setAttribute("y",B.y);D.onPlaceLabel(I,C)}});w.Label.HTML=new q({Implements:e.Label.HTML,initialize:function(x){this.viz=x},placeLabel:function(J,D,E){var H=D.pos.getc(true),A=this.viz.canvas,B=A.translateOffsetX,z=A.translateOffsetY,I=A.scaleOffsetX,G=A.scaleOffsetY,F=A.getSize(),x=this.viz.getRadius();var C={x:Math.round((H.x*I)*x+B+F.width/2),y:Math.round((H.y*G)*x+z+F.height/2)};var y=J.style;y.left=C.x+"px";y.top=C.y+"px";y.display=this.fitsInCanvas(C,A)?"":"none";E.onPlaceLabel(J,D)}});w.Plot.NodeTypes=new q({none:{render:c.empty,contains:c.lambda(false)},circle:{render:function(z,x){var y=this.node,B=z.getData("dim"),A=z.pos.getc();B=y.transform?B*(1-A.squaredNorm()):B;A.$scale(z.scale);if(B>0.2){this.nodeHelper.circle.render("fill",A,B,x)}},contains:function(x,A){var y=x.getData("dim"),z=x.pos.getc().$scale(x.scale);return this.nodeHelper.circle.contains(z,A,y)}},ellipse:{render:function(A,y){var B=A.pos.getc().$scale(A.scale),z=A.getData("width"),x=A.getData("height");this.nodeHelper.ellipse.render("fill",B,z,x,y)},contains:function(z,B){var y=z.getData("width"),x=z.getData("height"),A=z.pos.getc().$scale(z.scale);return this.nodeHelper.circle.contains(A,B,y,x)}},square:{render:function(z,x){var y=this.node,B=z.getData("dim"),A=z.pos.getc();B=y.transform?B*(1-A.squaredNorm()):B;A.$scale(z.scale);if(B>0.2){this.nodeHelper.square.render("fill",A,B,x)}},contains:function(x,A){var y=x.getData("dim"),z=x.pos.getc().$scale(x.scale);return this.nodeHelper.square.contains(z,A,y)}},rectangle:{render:function(B,y){var A=this.node,z=B.getData("width"),x=B.getData("height"),C=B.pos.getc();z=A.transform?z*(1-C.squaredNorm()):z;x=A.transform?x*(1-C.squaredNorm()):x;C.$scale(B.scale);if(z>0.2&&x>0.2){this.nodeHelper.rectangle.render("fill",C,z,x,y)}},contains:function(z,B){var y=z.getData("width"),x=z.getData("height"),A=z.pos.getc().$scale(z.scale);return this.nodeHelper.square.contains(A,B,y,x)}},triangle:{render:function(z,x){var y=this.node,B=z.getData("dim"),A=z.pos.getc();B=y.transform?B*(1-A.squaredNorm()):B;A.$scale(z.scale);if(B>0.2){this.nodeHelper.triangle.render("fill",A,B,x)}},contains:function(x,A){var y=x.getData("dim"),z=x.pos.getc().$scale(x.scale);return this.nodeHelper.triangle.contains(z,A,y)}},star:{render:function(z,x){var y=this.node,B=z.getData("dim"),A=z.pos.getc();B=y.transform?B*(1-A.squaredNorm()):B;A.$scale(z.scale);if(B>0.2){this.nodeHelper.star.render("fill",A,B,x)}},contains:function(x,A){var y=x.getData("dim"),z=x.pos.getc().$scale(x.scale);return this.nodeHelper.star.contains(z,A,y)}}});w.Plot.EdgeTypes=new q({none:c.empty,line:{render:function(x,y){var B=x.nodeFrom.pos.getc(true),A=x.nodeTo.pos.getc(true),z=x.nodeFrom.scale;this.edgeHelper.line.render({x:B.x*z,y:B.y*z},{x:A.x*z,y:A.y*z},y)},contains:function(x,B){var A=x.nodeFrom.pos.getc(true),z=x.nodeTo.pos.getc(true),y=x.nodeFrom.scale;this.edgeHelper.line.contains({x:A.x*y,y:A.y*y},{x:z.x*y,y:z.y*y},B,this.edge.epsilon)}},arrow:{render:function(y,z){var E=y.nodeFrom.pos.getc(true),D=y.nodeTo.pos.getc(true),A=y.nodeFrom.scale,C=y.getData("dim"),B=y.data.$direction,x=(B&&B.length>1&&B[0]!=y.nodeFrom.id);this.edgeHelper.arrow.render({x:E.x*A,y:E.y*A},{x:D.x*A,y:D.y*A},C,x,z)},contains:function(x,B){var A=x.nodeFrom.pos.getc(true),z=x.nodeTo.pos.getc(true),y=x.nodeFrom.scale;this.edgeHelper.arrow.contains({x:A.x*y,y:A.y*y},{x:z.x*y,y:z.y*y},B,this.edge.epsilon)}},hyperline:{render:function(x,y){var B=x.nodeFrom.pos.getc(),A=x.nodeTo.pos.getc(),z=this.viz.getRadius();this.edgeHelper.hyperline.render(B,A,z,y)},contains:c.lambda(false)}})})($jit.Hypertree)})(); \ No newline at end of file Index: src/main/resources/META-INF/static/style/images/header.jpg =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: src/main/resources/META-INF/static/images/addRule.gif =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: src/main/resources/META-INF/static/images/rdf_flyer_24.png =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: src/main/resources/META-INF/static/images/user_48.png =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: src/main/resources/META-INF/static/scripts/jsonToTurtle.js =================================================================== --- src/main/resources/META-INF/static/scripts/jsonToTurtle.js (revision 1148250) +++ src/main/resources/META-INF/static/scripts/jsonToTurtle.js (working copy) @@ -1,303 +0,0 @@ -/** - * Constructor: ex) var json = new JsonTurtle; - */ -function JsonTurtle(){ - this.rdfprop = 0; - return this; -} - -/** - * Get JSON data from a field, convert it to Turtle, and put into another field - * @param jfld : id of textarea that stores JSON data - * @param tfld : id of textarea to put Turtle serialization - */ -JsonTurtle.prototype.j2t = function(jfld, tfld){ - var j, t; - j = "{'safeval':" + document.getElementById(jfld).value + "}"; - try{ - eval('var d = ' + j); - document.getElementById(tfld).value = this.parsej(d.safeval,"\n",''); - }catch(e){ - alert("Error. Possibly dangerous code:\n" + e); - } -} - -/** - * Converts a (JSON) object to RDF/Turtle triples. - * @param obj : data object - * @param sep : triple separator (usually \n) - * @param pre : indent string. also indicates nest level. - * @param called_by : indicates whether parent 'element' is a Class. - * @return RDF/Turtle triples. - */ -JsonTurtle.prototype.parsej = function (obj, sep, pre, called_by){ - var res = ''; //result - var arg = { - 'pfdcl' : '', // prefix decl - 'caller': called_by, - 's' : '', // subject of triple - 'ctype' : '' // classtype - }; - var s, p, o; // triple s,p,o - var key; // JSON object key - if(pre == '') - this.rdfprop = 0; // capture whether rdf: property is used - - switch(typeof(obj)){ - case "string": - return this.set_object(obj); - case "boolean": - return '"' + obj + '"'; - case "number": - return obj; - case "undefined": - return '""'; - } - // without abov switch, {"p":["abc"]} will be - // [:p [rdf:_1 "a"; rdf:_2 "b"; rdf:_3 "c"]] . - // so, case object: - for(key in obj){ - //-- skip RDF syntax vocab. - switch(key){ - case 'rdf:resource': - return '<' + obj[key] + '>'; - case 'rdf:parseType': - continue; - case 'rdf:RDF': - return this.parsej(obj[key],sep,'',key); - case 'rdf:Description': - return this.prepare_pfx(arg, sep) + this.parsej(obj[key],sep,'',key); - case '#text': - return '"' + obj[key] + '"'; - } - - //-- property name to QName - p = this.set_qname(key); - - //-- set appropriate triple according to object type - switch(typeof(obj[key])){ - case "object": - res += this.proc_object(obj[key], p, pre, sep, arg); - break; - case "string": - o = this.set_object(obj[key]); - res += this.set_po(key, p, o, pre, sep, arg); - break; - case "number": - //case "boolean": - res += pre + p + ' ' + obj[key] + ';' + sep; - break; - default: - res += pre + p + ' "' + obj[key] + '";' + sep; - } - } - - //-- add bNode [] or collection (), or regard as continuing p-o seqence. - res = res ? res.slice(0,-2) : (p ? p : ":_undefined") + ' ""'; - res = (arg.s && pre=='') ? arg.s + res : - (arg.ctype == 'Collection' ? - '(' + sep + res + sep + pre + ')' : - ((arg.caller == 'C' || (pre == '' && arg.ctype)) ? sep + res: - '[' + sep + res + sep + pre + ']') - ); - return pre ? res : - this.prepare_pfx(arg, sep) + res + ' .'; -} - - -/** - * processes value tyep 'object' for JSON data - * @param val : JSON proprerty value (obj[key]) - * @param p : property QName - * @param sep : triple separator (usually \n) - * @param pre : indent string. also indicates nest level. - * @param arg : object of pfdcl, caller, s, ctype, by reference (set val) - * @return resulting triple - */ -JsonTurtle.prototype.proc_object = function(val, p, pre, sep, arg){ - var res, reslist = '', triple, s, ep, pp; - var o = {'ctype' : ''}; - if(val == null) - res = pre + p + ' "";' + sep; - - // case Array: treat array as repeated property, not a container - else if(val instanceof Array){//val.constructor == Array - var i; - for(i=0; i Collection - if(pre == ''){ - arg.s = '[]'; - res = sep + ':has_a (' + sep + reslist + '); ' - }else{ - o.ctype = 'Collection'; - //res = '(' + sep + reslist + pre + ') '; - res = reslist; - } - }else - res = reslist; - - // case Hash object: - }else{ - if(pre == ''){ - ep = '.'; - arg.caller = 'Root'; - }else - ep = ';'; - res = this.proc_obj_cp(val, p, pre, sep, ep, arg.caller, o); - if(pre == '' && o.ctype) arg.caller = 'Root'; - } - arg.ctype = o.ctype; - return res; -} - - -/** - * Processes object type data as class or property. If the property name - * starts with a capital letter, regard it as a Class - * @param obj : a data object - * @param p : property whose value is obj - * @param pre : indent string. also indicates nest level. - * @param sep : triple separator (usually \n) - * @param ep : end point of a triple in case a Class (usually '.') - * @param caller : indicates whether parent 'element' is a Class. - * @param o : object of ctype (to return value) - * @return composed Turle - */ -JsonTurtle.prototype.proc_obj_cp = function(obj, p, pre, sep, ep, caller, o){ - var res; - - if((p.split(':')[1]).match(/^[A-Z]/) && caller != 'C'){ - // if local name starts with a capital, regard as Class - // and treat nested object as p/o of the same subject - o.ctype = ' a ' + p + ';'; - res = pre + o.ctype + this.parsej(obj, "\n", ' ' + pre, 'C'); - if(caller == 'Root') - // list of classes called by root will be each independent - res = '[' + res + sep + ']' + ep + sep; - else - res += ep + sep; - // (only top level can have '.' for class, i.e. parallel triples) - }else{ - // else treat as bNode with predicateObjectList - res = pre + p + ' ' + this.parsej(obj, "\n", ' ' + pre) + ';' + sep; - } - return res; -} - - -/** - * set appropriate QName for property - * @param key : JSON proprerty name (key in obj) - * @return QName - */ -JsonTurtle.prototype.set_qname = function(key){ - var p; - if(key.indexOf(':') > -1) - // if contains ':' regard it as Qname -- maybe need clean up - p = key; - else if(key.match(/^\d+$/)){ - // Array has 0,1,2... as key --> RDF container member prop. - p = 'rdf:_' + (key*1+1); - this.rdfprop++; - }else - // treat as default namespaced name - p = ':' + key; - - // clean up property name - p = p.replace(/[^-:\w\d\u00c0-\ueffff]/g,'_'); // pseudo namechar - p = p.replace(/:([-\d])/,':_'+RegExp.$1); // local name start char - - return p; -} - - -/** - * set appropriate object for JSON data value - * @param val : JSON proprerty value (obj[key]) - * @return object in Turtle triple - */ -JsonTurtle.prototype.set_object = function(val){ - var o; - // if uri ref - if(val.match(/^<([-_\w\n\.~\?\&\/\@=;,#%:]+)>$/)) - o = "<" + RegExp.$1 + ">"; - //need this ? maybe should not ? - else if(val.match(/^http:([-_\w\n\.~\?\&\/\@=;,#%]+)$/)) - o = ""; - // or bNode - else if(val == "[]") - o = "[]"; - // or QName - else if(val.match(/^\w*:\w+$/)) - o = val; - // or literal - else{ - o = val.replace(/\n/g,"\\n"); - o = o.replace(/\"/g,"\\\""); - o = '"' + o + '"'; - } - - return o; -} - - -/** - * set property - object, or @prefix or subject, according to object value - * @param key : JSON object key (key in obj) - * @param p : property QName - * @param o : object - * @param pre : indent string. also indicates nest level. - * @param sep : triple separator (usually \n) - * @param arg : object of pfdcl, caller, s, ctype (set value for pfdcl, s) - * @return resulting part of triple - */ -JsonTurtle.prototype.set_po = function(key, p, o, pre, sep, arg){ - var res = '', pfx; - if(key.match(/^(\@prefix|xmlns)/)){ // ns prefix decl - pfx = key.split(':')[1]; - if(pfx == undefined) pfx = ''; - arg.pfdcl += "@prefix " + pfx + ": " + o + " ." + sep; - }else if(key.match(/^(\@|rdf:)about/)) // subject node - arg.s = o + sep; - else if(p == ':a') // a (rdf:type) - res = pre + 'a ' + o + ";" + sep; - else - res = pre + p + ' ' + o + ";" + sep; - - return res; -} - - -/** - * Prepares ns prefix declarations. If no @prefix, add an default ns. - * If model includes constructs from RDF ns and not ns ready, add one - * @param arg : object of pfdcl, caller, s, ctype - * @param sep : triple separator (usually \n) - * @return prepared @prefix directives - */ -JsonTurtle.prototype.prepare_pfx = function(arg, sep){ - var rdfns = ''; - if(arg.pfdcl == '') /*&& arg.caller != 'Root'*/ - arg.pfdcl= "@prefix : ." + sep; - if(this.rdfprop && arg.pfdcl.indexOf(rdfns) == -1) - arg.pfdcl += "@prefix rdf: " + rdfns + " ." + sep; - return arg.pfdcl; -} Index: src/main/resources/META-INF/static/style/images/wrapbg.gif =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: src/main/resources/META-INF/static/images/kresLogo.png =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: src/main/resources/META-INF/templates/imports/entities.ftl =================================================================== --- src/main/resources/META-INF/templates/imports/entities.ftl (revision 1148250) +++ src/main/resources/META-INF/templates/imports/entities.ftl (working copy) @@ -1,62 +0,0 @@ -<#-- - Licensed to the Apache Software Foundation (ASF) under one or more - contributor license agreements. See the NOTICE file distributed with - this work for additional information regarding copyright ownership. - The ASF licenses this file to You under the Apache License, Version 2.0 - (the "License"); you may not use this file except in compliance with - the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. ---> -<#macro listing entities iconsrc> -<#list entities as entity> -

- - - - - - - - -<#if entity.suggestions?size != 0> - - - - -<#list entity.suggestions as suggestion> - - - - - -<#if entity.mentions?size != 0> - - - - -<#list entity.mentions as mention> - - - - - - - -

- - \ No newline at end of file Index: src/main/resources/META-INF/static/images/anonymous_48.png =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: src/main/resources/META-INF/static/scripts/kres.js =================================================================== --- src/main/resources/META-INF/static/scripts/kres.js (revision 1148250) +++ src/main/resources/META-INF/static/scripts/kres.js (working copy) @@ -1,890 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one or more - contributor license agreements. See the NOTICE file distributed with - this work for additional information regarding copyright ownership. - The ASF licenses this file to You under the Apache License, Version 2.0 - (the "License"); you may not use this file except in compliance with - the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ -function showReengineer(dataSourceType){ - var dataSourceDiv = document.getElementById("data-source-form"); - if(dataSourceDiv != null){ - if(dataSourceType == 1){ - dataSourceDiv.innerHTML = "
" + - "Base URI for schema

" + - "Physical DB Name

" + - "JDBC Driver

" + - "Protocol

" + - "Host

" + - "Port

" + - "Username

" + - "Password

" + - "

" + - "" + - "
"; - } - else if(dataSourceType == 2){ - dataSourceDiv.innerHTML = "
" + - "Output graph URI

" + - "Input type

" + - "Input


" + - "" + - "
"; - } - else{ - dataSourceDiv.innerHTML = ""; - } - } - - -} - - -function getXMLHttpRequest() { - - - var XHR = null, - - userAgent = navigator.userAgent.toUpperCase(); - - if(typeof(XMLHttpRequest) === "function" || typeof(XMLHttpRequest) === "object") - XHR = new XMLHttpRequest(); - - else if(window.ActiveXObject && userAgent.indexOf("MSIE 4") < 0) { - - if(userAgent.indexOf("MSIE 5") < 0) - XHR = new ActiveXObject("Msxml2.XMLHTTP"); - else - XHR = new ActiveXObject("Microsoft.XMLHTTP"); - } - - return XHR; -} - - -function expandMenu(requester) { - var semionMenu = document.getElementById(requester); - var display = semionMenu.style.display; - if(display == '' || display == 'none' || display == null){ - semionMenu.style.display = 'block'; - } - else{ - semionMenu.style.display = 'none'; - } - -} - -function listScopes(withInactive){ - var ajax = getXMLHttpRequest(); - if(ajax != null){ - if(withInactive){ - ajax.open("get", "/kres/ontology?with-inactive=true", true); - } - else{ - ajax.open("get", "/kres/ontology", true); - } - ajax.setRequestHeader("Accept", "application/rdf+json"); - - var contentDIV = document.getElementById("content"); - - ajax.onreadystatechange = function() { - - // se le operazioni sono state effettuate - if(ajax.readyState == 4) { - if (ajax.status == 200) { - if(contentDIV != null){ - var jsonObj = ajax.responseText; - - var databank = $.rdf.databank().load(JSON.parse(jsonObj)); - databank.prefix('onm', 'http://kres.iks-project.eu/ontology/onm/meta.owl#'); - databank.prefix('rdf', 'http://www.w3.org/1999/02/22-rdf-syntax-ns#'); - databank.prefix('owl', 'http://www.w3.org/2002/07/owl#'); - - var rdf = $.rdf({databank:databank}); - - - var scopes = rdf.prefix('onm', 'http://kres.iks-project.eu/ontology/onm/meta.owl#') - .where('?scope a onm:Scope') - .select(); - - - var text = "

Ontology Network scopes

" + - "\"Add" + - ""; - if(withInactive){ - text += "Show also disabled scopes" - } - else{ - text += "Show also disabled scopes" - } - - contentDIV.innerHTML = text; - } - } - - } - } - - contentDIV.innerHTML = ""; - - ajax.send(null); - } -} - - -function showScopeConfigurationOptions(scopeID) { - var scopeDIV = document.getElementById(scopeID); - if(scopeDIV != null){ - var d = scopeDIV.style.display; - if(d==null || d=='none' || d==''){ - scopeDIV.style.display = 'block'; - } - else{ - scopeDIV.style.display = 'none'; - } - } -} - -function addScope(displayModule) { - if(displayModule){ - var content2 = "
" + - "
" + - "Scope ID:" + - "
" + - "Core registry:" + - "
" + - "Core ontology:" + - "
" + - "Custom registry:" + - "
" + - "Custom ontology:" + - "
" + - "Activate scope:" + - "
" + - "

"; - - TINY.box.show(content2,0,0,0,1); - } - else{ - var scopeID = document.getElementById("scopeid").value; - var corereg = document.getElementById("corereg").value; - var coreont = document.getElementById("coreont").value; - var customreg = document.getElementById("customreg").value; - var customont = document.getElementById("customont").value; - var activate = document.getElementById("activate"); - - var ajax = getXMLHttpRequest(); - if(ajax != null){ - ajax.onreadystatechange = function() { - - if(ajax.readyState == 4) { - if (ajax.status == 200) { - TINY.box.hide(); - var kresScopes = document.getElementById("kresScopes"); - if(kresScopes != null){ - var txt = document.createTextNode(scopeid); - - var newScope = document.createElement("li"); - newScope.appendChild(txt); - } - } - } - } - - var parameters = ""; - - if(corereg != ''){ - parameters += "corereg="+corereg; - } - if(coreont != ''){ - if(parameters != ''){ - parameters += "&"; - } - parameters += "coreont="+coreont; - } - if(customreg != ''){ - if(parameters != ''){ - parameters += "&"; - } - parameters += "customreg="+customreg; - } - if(customont != ''){ - if(parameters != ''){ - parameters += "&"; - } - parameters += "customont="+customont; - } - - if(parameters != ''){ - parameters += "&"; - } - if(activate.checked){ - parameters += "activate=true"; - } - else{ - parameters += "activate=false"; - } - ajax.open("put", "/kres/ontology/"+scopeID+"?"+parameters, true); - //alert(parameters); - ajax.send(null); - } - } -} - -function discoveryLinks(){ - var confIn = document.getElementById("confIn") - - if(confIn != null){ - var ajax = getXMLHttpRequest(); - - if(ajax != null){ - - ajax.open("post", "/kres/link-discovery", true); - - var parameter = "configuration="+confIn.value; - - ajax.onreadystatechange = function() { - if(ajax.readyState == 4) { - if (ajax.status == 200) { - } - } - } - } - - ajax.send(parameter); - } -} - - - - -function getGraphs(id, ns){ - var content = ""; - - var ajax = getXMLHttpRequest(); - if(ajax != null){ - ajax.open("get", "/kres/graphs/resume", false); - ajax.setRequestHeader("Accept", "application/rdf+json"); - ajax.send(null); - - content += "Select a graph from the store:
"; - content += ""; - } - - return content; -} - - -function getRecipies(){ - var content = ""; - - var ajax = getXMLHttpRequest(); - if(ajax != null){ - ajax.open("get", "/kres/recipe/all", false); - ajax.setRequestHeader("Accept", "application/rdf+json"); - ajax.send(null); - - content += "
Select a recipe from the rule store:
"; - content += ""; - } - - return content; -} - - -/* - * Refactoring - */ - -function runRefactoringStore(graph, recipe){ - alert("refactoring store"); -} - -function listRecipes(){ - var recipeListDIV = document.getElementById("recipeList"); - if(recipeListDIV != null){ - - - - - var ajax = getXMLHttpRequest(); - if(ajax != null){ - ajax.open("get", "/kres/recipe/all", true); - ajax.setRequestHeader("Accept", "application/rdf+json"); - - ajax.onreadystatechange = function() { - if(ajax.readyState == 4) { - if (ajax.status == 200) { - - - var content = "
    "; - - var jsonObj = ajax.responseText; - - var databank = $.rdf.databank().load(JSON.parse(jsonObj)); - - var rdf = $.rdf({databank:databank}); - - - var recipes = rdf.prefix('rmi', 'http://kres.iks-project.eu/ontology/meta/rmi.owl#') - .where('?recipe a rmi:Recipe') - .select(); - - content += "

    "; - for(var recipe in recipes){ - var recipeURI = recipes[recipe].recipe.toString(); - var r = recipeURI.replace("<", "").replace(">", ""); - content += "
  • "+ r; - content += "\"Configure\""; - content += "
    " + - "" + - "\"delete" + - "" + - "\"add" + - "" + - "\"list" + - "
    "; - } - - - content += "
"; - - - recipeListDIV.innerHTML = content; - - } - } - } - - ajax.send(null); - } - - recipeListDIV.style.display = 'block'; - - var addRecipeElement = document.getElementById("addRecipe"); - if(addRecipeElement != null){ - addRecipeElement.style.display = 'block'; - } - - var action = document.getElementById("action"); - if(action != null){ - action.href = "javascript:hideRecipes()"; - action.innerHTML = "hide"; - } - } -} - -function hideRecipes(){ - var recipeListDIV = document.getElementById("recipeList"); - if(recipeListDIV != null){ - recipeListDIV.style.display = 'none'; - } - - var addRecipeElement = document.getElementById("addRecipe"); - if(addRecipeElement != null){ - addRecipeElement.style.display = 'none'; - } - - var action = document.getElementById("action"); - if(action != null){ - action.href = "javascript:listRecipes()"; - action.innerHTML = "view"; - } -} - -function Recipe(){ - return this; -} - -Recipe.prototype.addRecipe = function(){ - - var recipeIDEl = document.getElementById("recipeid"); - var descriptionEl = document.getElementById("description"); - - var ajax = getXMLHttpRequest(); - if(ajax != null){ - ajax.open("post", "/kres/recipe", true); - ajax.setRequestHeader("Content-type", "application/x-www-form-urlencoded") - ajax.setRequestHeader("Accept", "application/rdf+json"); - - ajax.onreadystatechange = function() { - if(ajax.readyState == 4) { - if (ajax.status == 200) { - TINY.box.hide(); - listRecipes(); - } - } - } - } - - if(recipeIDEl != null && descriptionEl != null){ - var recipeID = recipeIDEl.value; - - var description = descriptionEl.value; - - var parameter = "recipe="+recipeID+"&description="+description; - - ajax.send(parameter); - } - - -} - -Recipe.prototype.displayAddBox = function(){ - var content2 = "
" + - "
" + - "Recipe ID:" + - "
" + - "Recipe description:" + - "
" + - "

"; - - TINY.box.show(content2,0,0,0,1); -} - -function loadGraph(element, json) { - var ht = new $jit.Hypertree({ - //id of the visualization container - injectInto: element, - //canvas width and height - width: 50, - height: 50, - //Change node and edge styles such as - //color, width and dimensions. - Node: { - dim: 9, - color: "#f00" - }, - Edge: { - lineWidth: 2, - color: "#088" - }, - onBeforeCompute: function(node){ - Log.write("centering"); - }, - //Attach event handlers and add text to the - //labels. This method is only triggered on label - //creation - onCreateLabel: function(domElement, node){ - domElement.innerHTML = node.name; - $jit.util.addEvent(domElement, 'click', function () { - ht.onClick(node.id); - }); - }, - //Change node styles when labels are placed - //or moved. - onPlaceLabel: function(domElement, node){ - var style = domElement.style; - style.display = ''; - style.cursor = 'pointer'; - if (node._depth <= 1) { - style.fontSize = "0.8em"; - style.color = "#ddd"; - - } else if(node._depth == 2){ - style.fontSize = "0.7em"; - style.color = "#555"; - - } else { - style.display = 'none'; - } - - var left = parseInt(style.left); - var w = domElement.offsetWidth; - style.left = (left - w / 2) + 'px'; - }, - - onAfterCompute: function(){ - Log.write("done"); - - //Build the right column relations list. - //This is done by collecting the information (stored in the data property) - //for all the nodes adjacent to the centered node. - var node = ht.graph.getClosestNodeToOrigin("current"); - var html = "

" + node.name + "

Connections:"; - html += "
    "; - node.eachAdjacency(function(adj){ - var child = adj.nodeTo; - if (child.data) { - var rel = (child.data.band == node.name) ? child.data.relation : node.data.relation; - html += "
  • " + child.name + " " + "
    (relation: " + rel + ")
  • "; - } - }); - html += "
"; - $jit.id(element+"-details").innerHTML = html; - } - }); - //load JSON data. - ht.loadJSON(json); - //compute positions and plot. - ht.refresh(); -} - -function Rule(){ - return this; -} - -Rule.prototype.addRule = function(){ - var recipeIDEl = document.getElementById("recipeid"); - var ruleIDEl = document.getElementById("ruleid"); - var ruleEl = document.getElementById("rule"); - var descriptionEl = document.getElementById("description"); - - var ajax = getXMLHttpRequest(); - if(ajax != null){ - ajax.open("post", "/kres/rule", true); - ajax.setRequestHeader("Content-type", "application/x-www-form-urlencoded") - - ajax.onreadystatechange = function() { - if(ajax.readyState == 4) { - if (ajax.status == 200) { - TINY.box.hide(); - listRecipes(); - } - } - } - } - - if(recipeIDEl != null && ruleIDEl != null && ruleEl != null && descriptionEl != null){ - var recipeID = recipeIDEl.value; - var ruleID = ruleIDEl.value; - var rule = ruleEl.value; - var description = descriptionEl.value; - - var parameter = "recipe="+recipeID+"&rule="+ruleID+"&kres-syntax="+rule+"&description="+description; - - ajax.send(parameter); - } -} - -Rule.prototype.displayAddBox = function(recipe){ - var content2 = "
" + - "
" + - "Recipe ID" + - "
" + - "Rule ID:"+ - "
" + - "Rule:"+ - "


" + - "Description:"+ - "
" + - "

"; - - TINY.box.show(content2,0,0,0,1); -} - -Rule.prototype.listRulesOfRecipe = function(recipe){ - - var div = document.getElementById("rulesOfrecipe"+recipe); - if(div == null){ - - var ajax = getXMLHttpRequest(); - if(ajax != null){ - recipe = recipe.replace("#", "%23"); - ajax.open("get", "/kres/rule/of-recipe/"+recipe, true); - ajax.setRequestHeader("Accept", "application/rdf+json"); - ajax.onreadystatechange = function() { - if(ajax.readyState == 4) { - if (ajax.status == 200) { - var jsonObj = ajax.responseText; - - alert(jsonObj); - var databank = $.rdf.databank().load(JSON.parse(jsonObj)); - - var rdf = $.rdf({databank:databank}); - - recipe = recipe.replace("%23", "#"); - var rules = rdf.prefix('rmi', 'http://kres.iks-project.eu/ontology/meta/rmi.owl#') - .where('<' + recipe + '> rmi:hasRule ?rule') - .select(); - - - var content = "


"; - - for(var rule in rules){ - - var ruleURI = rules[rule].rule.toString(); - var r = ruleURI.replace("<", "").replace(">", ""); - content += "
  • "+ r; - content += "\"Configure\""; - content += "
    " + - "" + - "\"delete" + - "" + - "\"add" + - "" + - "\"list" + - "
    "; - } - - - content += ""; - - content += "
    "; - content += "
    "; - - content += "
  • "; - - - var ruleListDIV = document.getElementById(recipe); - if(ruleListDIV != null){ - ruleListDIV.innerHTML = ruleListDIV.innerHTML + content; - } - - loadGraph("visualization"+recipe, jsonObj); - } - } - } - - ajax.send(null); - } - } - else{ - div.style.display = 'block'; - } - var listRulesA = document.getElementById("listRulesA"); - if(listRulesA != null){ - listRulesA.href = "javascript: var rule = new Rule(); rule.hideRulesOfRecipe('"+recipe+"');"; - } -} - -Rule.prototype.hideRulesOfRecipe = function(recipe){ - var div = document.getElementById("rulesOfrecipe"+recipe); - if(div != null){ - div.style.display = 'none'; - } - - var listRulesA = document.getElementById("listRulesA"); - if(listRulesA != null){ - listRulesA.href = "javascript: var rule = new Rule(); rule.listRulesOfRecipe('"+recipe+"');"; - } -} - -function Refactorer(){ - return this; -} - -Refactorer.prototype.runRefactoringStoreLazy = function() { - var recipeEl = document.getElementById("recipe"); - var inputGraphEl = document.getElementById("input-graph"); - var outputGraphEl = document.getElementById("output-graph"); - - if(recipeEl!=null && inputGraphEl!=null && outputGraphEl!=null){ - var ajax = getXMLHttpRequest(); - if(ajax != null){ - - var recipe = recipeEl.value.replace("#", "%23"); - var inputGraph = inputGraphEl.value.replace("#", "%23"); - var outputGraph = outputGraphEl.value.replace("#", "%23"); - alert(outputGraph +" - "+inputGraph+" - "+recipe); - ajax.open("get", "/kres/refactorer/lazy?recipe="+recipe+"&input-graph="+inputGraph+"&output-graph="+outputGraph, true); - ajax.setRequestHeader("Accept", "application/rdf+json"); - ajax.onreadystatechange = function() { - if(ajax.readyState == 4) { - if (ajax.status == 200) { - alert("Refactoring completed"); - } - } - } - ajax.send(null); - } - } -} - -Refactorer.prototype.runRefactoringFileLazy = function() { - - var formEl = document.getElementById("iForm"); - if(formEl != null){ - formEl.submit(); - } - /*var recipeEl = document.getElementById("recipe"); - var inputGraphEl = document.getElementById("graph"); - - if(recipeEl!=null && inputGraphEl!=null){ - var ajax = getXMLHttpRequest(); - if(ajax != null){ - - var recipe = recipeEl.value; - var inputGraph = inputGraphEl.value; - - alert("recipe: "+recipe+" - input: "+inputGraph); - ajax.open("post", "/kres/refactorer/lazy", true); - ajax.setRequestHeader("Accept", "application/rdf+json"); - ajax.onreadystatechange = function() { - if(ajax.readyState == 4) { - if (ajax.status == 200) { - alert("Refactoring completed"); - } - } - } - - var parameters = "recipe='"+recipe+"'&input="+inputGraph - ajax.send(parameters); - } - }*/ -} - -Refactorer.prototype.showRefactoring = function(type, ns){ - var contentTag = document.getElementById("refactoring"); - - var content = ""; - if(contentTag != null){ - var submit = ""; - if(type == 0){ - content += getGraphs("input-graph", ns); - content += "Output graph ID
    "; - - submit = ""; - } - else{ - content += "
    "; - content += "Select a graph from file:
    "; - - submit += "
    "; - - } - - content += getRecipies(); - content += submit; - - contentTag.style.display = 'block'; - contentTag.innerHTML = content; - } -} - -function Storage(){ - return this; -} - -Storage.prototype.loadGraph = function(graphID) { - graphID = graphID.replace("<", "").replace(">", "").replace("#", "%23"); - var ajax = getXMLHttpRequest(); - if(ajax != null){ - - - ajax.open("get", "/kres/graphs/"+graphID, true); - ajax.setRequestHeader("Accept", "application/rdf+xml"); - ajax.onreadystatechange = function() { - if(ajax.readyState == 4) { - if (ajax.status == 200) { - var response = ajax.responseText; - if(response != null){ - var div = document.getElementById("graphDIV"); - if(div != null){ - response = response.replace("<", "<").replace(">", ">"); - div.innerHTML = ""+response+""; - div.style.display = 'block'; - } - } - } - } - } - - ajax.send(null); - } -} - -function Demo(){ - return this; -} - -Demo.prototype.enhance = function(content) { - var ajax = getXMLHttpRequest(); - if(ajax != null){ - ajax.open("post", "/engines", true); - ajax.setRequestHeader("Content-type", "application/x-www-form-urlencoded") - ajax.onreadystatechange = function() { - if(ajax.readyState == 4) { - if (ajax.status == 200) { - var jsonObj = ajax.responseText; - - var databank = $.rdf.databank().load(JSON.parse(jsonObj)); - - var rdf = $.rdf({databank:databank}); - - - var references = rdf.prefix('fise', 'http://fise.iks-project.eu/ontology/') - .where('?subject fise:entity-reference ?reference') - .select(); - var content = ""; - for(var reference in references){ - var referenceURI = references[reference].reference.toString(); - content += reference+"
    "; - } - - var div = document.getElementById("fiseResult"); - if(div != null){ - div.innerHTML = content; - div.style.display = 'block'; - - } - } - } - } - - var parameter = "content="+content+"&format=application/rdf+json"; - ajax.send(parameter); - } - -} \ No newline at end of file Index: src/main/resources/META-INF/static/images/rules.gif =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: src/main/resources/META-INF/static/images/user_group_48.png =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: src/main/resources/META-INF/static/images/stlabLogo.png =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: src/main/resources/META-INF/static/style/kres.css =================================================================== --- src/main/resources/META-INF/static/style/kres.css (revision 1148250) +++ src/main/resources/META-INF/static/style/kres.css (working copy) @@ -1,124 +0,0 @@ -/* -* Licensed to the Apache Software Foundation (ASF) under one or more -* contributor license agreements. See the NOTICE file distributed with -* this work for additional information regarding copyright ownership. -* The ASF licenses this file to You under the Apache License, Version 2.0 -* (the "License"); you may not use this file except in compliance with -* the License. You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -* {margin:0; padding:0;} - -/******** General tags ********/ -body {margin:25px auto; padding:0; font:76% Verdana,Tahoma,Arial,sans-serif; background:#1e3044; color:#303030; line-height:1.3em;} -a {text-decoration:none; color:#20526a; font-weight:bold;} -a:hover {text-decoration:underline; color:#20526a;} -a img {border:0;} -p {margin:0 0 18px 8px;} -h2 {font-size:1.5em; font-weight:normal; letter-spacing:-1px; margin:10px 0 8px 0;} -h3 {font-size:1.2em; margin:2px 0 8px 0;} - -/******** Main wrap ********/ -#wrap {background:#ffffff url(images/wrapbg.gif) top left repeat-y; color:#303030; margin:0 auto; width:760px;} - -/******** Header ********/ -#header {clear:both; background:url(images/header.jpg) top left no-repeat; height:150px;} -#header h1 {font-size:3.8em; letter-spacing:-4px; color:#d88d44; padding:10px 0 10px 45px;} -#header h1 a {color:#d88d44; text-decoration:none;} -#header h1 a:hover {color:#e99e55;} -#slogan {color:#20526a; margin:60px 0 0 45px; font-size:1.6em; letter-spacing:-1px; } - -#leftHeader {width: 15%; float: left;} -#rightHeader {width: 85%; float: right;} - -/******** Sitemenu, left sidebar ********/ -#sitemenu {clear:both; float:left; width:135px; margin:0; padding:20px 0 0 15px;} -#sitemenu ul {list-style:none; width:135px; margin:0 0 20px 0; padding:0; font-size:1#2em; letter-spacing:-1px;} -#sitemenu li {margin-bottom:4px;} -#sitemenu li a {font-weight:bold; text-decoration:none; color:#20526a; display:block; height:1.1em; padding:2px 2px 2px 8px; border-left: 8px solid #70a2ba;} -#sitemenu li a:hover {color:#d88d44; text-decoration:none; border-left:8px solid #d88d44;} -#sitemenu #current {border-left:8px solid #d88d44;} -#sitemenu ul ul {font-size:0.8em; width:110px; font-weight:normal; margin:5px 0 8px 20px;} -#sitemenu ul ul li {margin-bottom:2px;} -#sitemenu ul ul li a {border:0; padding:2px;} -#sitemenu ul ul li a:hover {border:0; padding:2px; text-decoration:underline;} - -/******** Extras, right sitebar ********/ -#extras {float:right; width:135px; margin:0; padding:10px 15px 0 0;} -#extras ul {margin:0 0 14px 2px; list-style:none; color:#808080;} -#extras li {margin:0 0 2px 0;} -#extras li a {padding:2px 2px 2px 2px; height:1.2em; letter-spacing:-1px; font-weight:bold;} -#extras li a:hover {color:#d88d44;} -#extras ul ul, #extras ul ul ul {font-size:0.9em; line-height:1.2em; margin:2px 0 2px 15px;} -#extras ul ul a, #extras ul ul ul a {font-weight:normal;} - -/******** Content variations ********/ -#content {margin:5px 170px 0 170px; padding:2px 0 0 0; line-height:1.5em; text-align:left;} -#content h2 {font-size:1.6em; margin:20px 0 10px 0;} -#content h3 {font-size:1.4em; font-weight:normal; letter-spacing:-1px; margin:10px 0 8px 0;} -#content p {text-align:justify;} - -/******** Footer ********/ -#footer {clear:both; margin:5px auto 0 auto; padding:10px 0 10px 0; width:760px; text-align:center; background: url(images/footer.jpg) bottom left no-repeat; color:#555; font-size:0.9em; line-height:1.5em;} -#footer p {margin:3px;} -#footer p strong {font-size:1.1em; font-weight:400;} -#footer a {color:#777; font-weight:400; text-decoration:none;} -#footer a:hover {text-decoration:underline;} - -/******** Various classes ********/ -.datetag {width:50px; padding:0 0 10px 0; text-align:center; background:.20526a url(images/date-bottom.gif) bottom left no-repeat; margin:2px 15px 1px 10px; color:.ffffff; font-size:2.2em; text-align:center; float:left;} -.datetag .date {width:50px; display:block; letter-spacing:-1px; padding:15px 0 5px 0; background:.20526a url(images/date-top.gif) top left no-repeat;} -.datetag .month {font-size:0.5em; letter-spacing:-1px; width:50px; display:block; font-weight:bold;} -.textright {text-align:right;} -.center {text-align:center;} -.frontphoto {margin:20px 0 10px 0;} -.small {font-size:0.8em;} -.bold {font-weight:bold;} -.clear {clear:both;} -.hide {display:none;} - -input.url {width: 400px;} - -div#data-source-form{ - margin-left: 25px; - margin-top: 25px; -} - -ul.kressList{ - margin: 0 0 0 25px; -} - -.indent{margin-left: 20px;} -.indent code{border: thin; border-style: dotted; padding: 5px 5px 5px 5px;} - - -.configure {margin-left: 5px; width: 12px; height: 12px;} -.scopeDIV {margin: 20px 0 20px 20px; display: none;} -.contentAlign {margin: 20px 0 0 20px;} -.menuLeft {width: 80%; float: left;} -.menuRight {width: 20%; float: right; margin-top: 10px;} -.menuRightText {width: 20%; float: right;} -.contentTag {margin-right: 10px;} -.contentTagNoShow {margin: 30px 0 0 30px; display: none;} -.refactor {width: 350px; margin-bottom: 10px;} - -#recipeList {display: none; width: 100%;} - -#tinybox {width:230px; height:190px; display:none; padding:10px; background:#fff url(img/loading.gif) no-repeat 50% 50%; border:10px solid #e3e3e3; z-index:2000} -#tinymask {text-align:center; position:absolute; display:none; top:0; left:0; height:100%; width:100%; background:#000; z-index:1500} -#tinycontent {background:#fff} - -.code {width: 300px;} - -.contentTag fieldset {border-color: #d1dfce; border-style: solid; border-width: 1px; width: 380px; margin: 0 0 30px 18px;} -.contentTag div.fieldset {margin: 20px 20px 20px 20px;} -.fieldset select {width: 300px;} -.fieldset .code {width: 200px;} \ No newline at end of file Index: src/main/resources/META-INF/static/style/images/frontphoto.jpg =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: src/main/resources/META-INF/static/images/favicon.png =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: src/main/resources/META-INF/static/images/rdf.png =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: src/main/resources/META-INF/static/scripts/prettify/kres.css =================================================================== --- src/main/resources/META-INF/static/scripts/prettify/kres.css (revision 1148250) +++ src/main/resources/META-INF/static/scripts/prettify/kres.css (working copy) @@ -1,26 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one or more - contributor license agreements. See the NOTICE file distributed with - this work for additional information regarding copyright ownership. - The ASF licenses this file to You under the Apache License, Version 2.0 - (the "License"); you may not use this file except in compliance with - the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -div.dataSourceCheck { - display:none; - margin-left: 20px -} - -div.dataSourceSubCheck{ - display:none; - margin-left: 20px -} Index: src/main/resources/META-INF/static/style/images/date-bottom.gif =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: src/main/resources/META-INF/static/images/fise_logo_white.png =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: src/main/resources/META-INF/static/scripts/prettify/prettify.js =================================================================== --- src/main/resources/META-INF/static/scripts/prettify/prettify.js (revision 1148250) +++ src/main/resources/META-INF/static/scripts/prettify/prettify.js (working copy) @@ -1,1478 +0,0 @@ -// Copyright (C) 2006 Google Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - - -/** - * @fileoverview - * some functions for browser-side pretty printing of code contained in html. - *

    - * - * For a fairly comprehensive set of languages see the - * README - * file that came with this source. At a minimum, the lexer should work on a - * number of languages including C and friends, Java, Python, Bash, SQL, HTML, - * XML, CSS, Javascript, and Makefiles. It works passably on Ruby, PHP and Awk - * and a subset of Perl, but, because of commenting conventions, doesn't work on - * Smalltalk, Lisp-like, or CAML-like languages without an explicit lang class. - *

    - * Usage:

      - *
    1. include this source file in an html page via - * {@code } - *
    2. define style rules. See the example page for examples. - *
    3. mark the {@code
      } and {@code } tags in your source with
      - *    {@code class=prettyprint.}
      - *    You can also use the (html deprecated) {@code } tag, but the pretty
      - *    printer needs to do more substantial DOM manipulations to support that, so
      - *    some css styles may not be preserved.
      - * </ol>
      - * That's it.  I wanted to keep the API as simple as possible, so there's no
      - * need to specify which language the code is in, but if you wish, you can add
      - * another class to the {@code <pre>} or {@code <code>} element to specify the
      - * language, as in {@code <pre class="prettyprint lang-java">}.  Any class that
      - * starts with "lang-" followed by a file extension, specifies the file type.
      - * See the "lang-*.js" files in this directory for code that implements
      - * per-language file handlers.
      - * <p>
      - * Change log:<br>
      - * cbeust, 2006/08/22
      - * <blockquote>
      - *   Java annotations (start with "@") are now captured as literals ("lit")
      - * </blockquote>
      - * @requires console
      - * @overrides window
      - */
      -
      -// JSLint declarations
      -/*global console, document, navigator, setTimeout, window */
      -
      -/**
      - * Split {@code prettyPrint} into multiple timeouts so as not to interfere with
      - * UI events.
      - * If set to {@code false}, {@code prettyPrint()} is synchronous.
      - */
      -window['PR_SHOULD_USE_CONTINUATION'] = true;
      -
      -/** the number of characters between tab columns */
      -window['PR_TAB_WIDTH'] = 8;
      -
      -/** Walks the DOM returning a properly escaped version of innerHTML.
      -  * @param {Node} node
      -  * @param {Array.<string>} out output buffer that receives chunks of HTML.
      -  */
      -window['PR_normalizedHtml']
      -
      -/** Contains functions for creating and registering new language handlers.
      -  * @type {Object}
      -  */
      -  = window['PR']
      -
      -/** Pretty print a chunk of code.
      -  *
      -  * @param {string} sourceCodeHtml code as html
      -  * @return {string} code as html, but prettier
      -  */
      -  = window['prettyPrintOne']
      -/** Find all the {@code <pre>} and {@code <code>} tags in the DOM with
      -  * {@code class=prettyprint} and prettify them.
      -  * @param {Function?} opt_whenDone if specified, called when the last entry
      -  *     has been finished.
      -  */
      -  = window['prettyPrint'] = void 0;
      -
      -/** browser detection. @extern @returns false if not IE, otherwise the major version. */
      -window['_pr_isIE6'] = function () {
      -  var ieVersion = navigator && navigator.userAgent &&
      -      navigator.userAgent.match(/\bMSIE ([678])\./);
      -  ieVersion = ieVersion ? +ieVersion[1] : false;
      -  window['_pr_isIE6'] = function () { return ieVersion; };
      -  return ieVersion;
      -};
      -
      -
      -(function () {
      -  // Keyword lists for various languages.
      -  var FLOW_CONTROL_KEYWORDS =
      -      "break continue do else for if return while ";
      -  var C_KEYWORDS = FLOW_CONTROL_KEYWORDS + "auto case char const default " +
      -      "double enum extern float goto int long register short signed sizeof " +
      -      "static struct switch typedef union unsigned void volatile ";
      -  var COMMON_KEYWORDS = C_KEYWORDS + "catch class delete false import " +
      -      "new operator private protected public this throw true try typeof ";
      -  var CPP_KEYWORDS = COMMON_KEYWORDS + "alignof align_union asm axiom bool " +
      -      "concept concept_map const_cast constexpr decltype " +
      -      "dynamic_cast explicit export friend inline late_check " +
      -      "mutable namespace nullptr reinterpret_cast static_assert static_cast " +
      -      "template typeid typename using virtual wchar_t where ";
      -  var JAVA_KEYWORDS = COMMON_KEYWORDS +
      -      "abstract boolean byte extends final finally implements import " +
      -      "instanceof null native package strictfp super synchronized throws " +
      -      "transient ";
      -  var CSHARP_KEYWORDS = JAVA_KEYWORDS +
      -      "as base by checked decimal delegate descending event " +
      -      "fixed foreach from group implicit in interface internal into is lock " +
      -      "object out override orderby params partial readonly ref sbyte sealed " +
      -      "stackalloc string select uint ulong unchecked unsafe ushort var ";
      -  var JSCRIPT_KEYWORDS = COMMON_KEYWORDS +
      -      "debugger eval export function get null set undefined var with " +
      -      "Infinity NaN ";
      -  var PERL_KEYWORDS = "caller delete die do dump elsif eval exit foreach for " +
      -      "goto if import last local my next no our print package redo require " +
      -      "sub undef unless until use wantarray while BEGIN END ";
      -  var PYTHON_KEYWORDS = FLOW_CONTROL_KEYWORDS + "and as assert class def del " +
      -      "elif except exec finally from global import in is lambda " +
      -      "nonlocal not or pass print raise try with yield " +
      -      "False True None ";
      -  var RUBY_KEYWORDS = FLOW_CONTROL_KEYWORDS + "alias and begin case class def" +
      -      " defined elsif end ensure false in module next nil not or redo rescue " +
      -      "retry self super then true undef unless until when yield BEGIN END ";
      -  var SH_KEYWORDS = FLOW_CONTROL_KEYWORDS + "case done elif esac eval fi " +
      -      "function in local set then until ";
      -  var ALL_KEYWORDS = (
      -      CPP_KEYWORDS + CSHARP_KEYWORDS + JSCRIPT_KEYWORDS + PERL_KEYWORDS +
      -      PYTHON_KEYWORDS + RUBY_KEYWORDS + SH_KEYWORDS);
      -
      -  // token style names.  correspond to css classes
      -  /** token style for a string literal */
      -  var PR_STRING = 'str';
      -  /** token style for a keyword */
      -  var PR_KEYWORD = 'kwd';
      -  /** token style for a comment */
      -  var PR_COMMENT = 'com';
      -  /** token style for a type */
      -  var PR_TYPE = 'typ';
      -  /** token style for a literal value.  e.g. 1, null, true. */
      -  var PR_LITERAL = 'lit';
      -  /** token style for a punctuation string. */
      -  var PR_PUNCTUATION = 'pun';
      -  /** token style for a punctuation string. */
      -  var PR_PLAIN = 'pln';
      -
      -  /** token style for an sgml tag. */
      -  var PR_TAG = 'tag';
      -  /** token style for a markup declaration such as a DOCTYPE. */
      -  var PR_DECLARATION = 'dec';
      -  /** token style for embedded source. */
      -  var PR_SOURCE = 'src';
      -  /** token style for an sgml attribute name. */
      -  var PR_ATTRIB_NAME = 'atn';
      -  /** token style for an sgml attribute value. */
      -  var PR_ATTRIB_VALUE = 'atv';
      -
      -  /**
      -   * A class that indicates a section of markup that is not code, e.g. to allow
      -   * embedding of line numbers within code listings.
      -   */
      -  var PR_NOCODE = 'nocode';
      -
      -  /** A set of tokens that can precede a regular expression literal in
      -    * javascript.
      -    * http://www.mozilla.org/js/language/js20/rationale/syntax.html has the full
      -    * list, but I've removed ones that might be problematic when seen in
      -    * languages that don't support regular expression literals.
      -    *
      -    * <p>Specifically, I've removed any keywords that can't precede a regexp
      -    * literal in a syntactically legal javascript program, and I've removed the
      -    * "in" keyword since it's not a keyword in many languages, and might be used
      -    * as a count of inches.
      -    *
      -    * <p>The link a above does not accurately describe EcmaScript rules since
      -    * it fails to distinguish between (a=++/b/i) and (a++/b/i) but it works
      -    * very well in practice.
      -    *
      -    * @private
      -    */
      -  var REGEXP_PRECEDER_PATTERN = function () {
      -      var preceders = [
      -          "!", "!=", "!==", "#", "%", "%=", "&", "&&", "&&=",
      -          "&=", "(", "*", "*=", /* "+", */ "+=", ",", /* "-", */ "-=",
      -          "->", /*".", "..", "...", handled below */ "/", "/=", ":", "::", ";",
      -          "<", "<<", "<<=", "<=", "=", "==", "===", ">",
      -          ">=", ">>", ">>=", ">>>", ">>>=", "?", "@", "[",
      -          "^", "^=", "^^", "^^=", "{", "|", "|=", "||",
      -          "||=", "~" /* handles =~ and !~ */,
      -          "break", "case", "continue", "delete",
      -          "do", "else", "finally", "instanceof",
      -          "return", "throw", "try", "typeof"
      -          ];
      -      var pattern = '(?:^^|[+-]';
      -      for (var i = 0; i < preceders.length; ++i) {
      -        pattern += '|' + preceders[i].replace(/([^=<>:&a-z])/g, '\\$1');
      -      }
      -      pattern += ')\\s*';  // matches at end, and matches empty string
      -      return pattern;
      -      // CAVEAT: this does not properly handle the case where a regular
      -      // expression immediately follows another since a regular expression may
      -      // have flags for case-sensitivity and the like.  Having regexp tokens
      -      // adjacent is not valid in any language I'm aware of, so I'm punting.
      -      // TODO: maybe style special characters inside a regexp as punctuation.
      -    }();
      -
      -  // Define regexps here so that the interpreter doesn't have to create an
      -  // object each time the function containing them is called.
      -  // The language spec requires a new object created even if you don't access
      -  // the $1 members.
      -  var pr_amp = /&/g;
      -  var pr_lt = /</g;
      -  var pr_gt = />/g;
      -  var pr_quot = /\"/g;
      -  /** like textToHtml but escapes double quotes to be attribute safe. */
      -  function attribToHtml(str) {
      -    return str.replace(pr_amp, '&amp;')
      -        .replace(pr_lt, '&lt;')
      -        .replace(pr_gt, '&gt;')
      -        .replace(pr_quot, '&quot;');
      -  }
      -
      -  /** escapest html special characters to html. */
      -  function textToHtml(str) {
      -    return str.replace(pr_amp, '&amp;')
      -        .replace(pr_lt, '&lt;')
      -        .replace(pr_gt, '&gt;');
      -  }
      -
      -
      -  var pr_ltEnt = /&lt;/g;
      -  var pr_gtEnt = /&gt;/g;
      -  var pr_aposEnt = /&apos;/g;
      -  var pr_quotEnt = /&quot;/g;
      -  var pr_ampEnt = /&amp;/g;
      -  var pr_nbspEnt = /&nbsp;/g;
      -  /** unescapes html to plain text. */
      -  function htmlToText(html) {
      -    var pos = html.indexOf('&');
      -    if (pos < 0) { return html; }
      -    // Handle numeric entities specially.  We can't use functional substitution
      -    // since that doesn't work in older versions of Safari.
      -    // These should be rare since most browsers convert them to normal chars.
      -    for (--pos; (pos = html.indexOf('&#', pos + 1)) >= 0;) {
      -      var end = html.indexOf(';', pos);
      -      if (end >= 0) {
      -        var num = html.substring(pos + 3, end);
      -        var radix = 10;
      -        if (num && num.charAt(0) === 'x') {
      -          num = num.substring(1);
      -          radix = 16;
      -        }
      -        var codePoint = parseInt(num, radix);
      -        if (!isNaN(codePoint)) {
      -          html = (html.substring(0, pos) + String.fromCharCode(codePoint) +
      -                  html.substring(end + 1));
      -        }
      -      }
      -    }
      -
      -    return html.replace(pr_ltEnt, '<')
      -        .replace(pr_gtEnt, '>')
      -        .replace(pr_aposEnt, "'")
      -        .replace(pr_quotEnt, '"')
      -        .replace(pr_nbspEnt, ' ')
      -        .replace(pr_ampEnt, '&');
      -  }
      -
      -  /** is the given node's innerHTML normally unescaped? */
      -  function isRawContent(node) {
      -    return 'XMP' === node.tagName;
      -  }
      -
      -  var newlineRe = /[\r\n]/g;
      -  /**
      -   * Are newlines and adjacent spaces significant in the given node's innerHTML?
      -   */
      -  function isPreformatted(node, content) {
      -    // PRE means preformatted, and is a very common case, so don't create
      -    // unnecessary computed style objects.
      -    if ('PRE' === node.tagName) { return true; }
      -    if (!newlineRe.test(content)) { return true; }  // Don't care
      -    var whitespace = '';
      -    // For disconnected nodes, IE has no currentStyle.
      -    if (node.currentStyle) {
      -      whitespace = node.currentStyle.whiteSpace;
      -    } else if (window.getComputedStyle) {
      -      // Firefox makes a best guess if node is disconnected whereas Safari
      -      // returns the empty string.
      -      whitespace = window.getComputedStyle(node, null).whiteSpace;
      -    }
      -    return !whitespace || whitespace === 'pre';
      -  }
      -
      -  function normalizedHtml(node, out) {
      -    switch (node.nodeType) {
      -      case 1:  // an element
      -        var name = node.tagName.toLowerCase();
      -        out.push('<', name);
      -        for (var i = 0; i < node.attributes.length; ++i) {
      -          var attr = node.attributes[i];
      -          if (!attr.specified) { continue; }
      -          out.push(' ');
      -          normalizedHtml(attr, out);
      -        }
      -        out.push('>');
      -        for (var child = node.firstChild; child; child = child.nextSibling) {
      -          normalizedHtml(child, out);
      -        }
      -        if (node.firstChild || !/^(?:br|link|img)$/.test(name)) {
      -          out.push('<\/', name, '>');
      -        }
      -        break;
      -      case 2: // an attribute
      -        out.push(node.name.toLowerCase(), '="', attribToHtml(node.value), '"');
      -        break;
      -      case 3: case 4: // text
      -        out.push(textToHtml(node.nodeValue));
      -        break;
      -    }
      -  }
      -
      -  /**
      -   * Given a group of {@link RegExp}s, returns a {@code RegExp} that globally
      -   * matches the union o the sets o strings matched d by the input RegExp.
      -   * Since it matches globally, if the input strings have a start-of-input
      -   * anchor (/^.../), it is ignored for the purposes of unioning.
      -   * @param {Array.<RegExp>} regexs non multiline, non-global regexs.
      -   * @return {RegExp} a global regex.
      -   */
      -  function combinePrefixPatterns(regexs) {
      -    var capturedGroupIndex = 0;
      -
      -    var needToFoldCase = false;
      -    var ignoreCase = false;
      -    for (var i = 0, n = regexs.length; i < n; ++i) {
      -      var regex = regexs[i];
      -      if (regex.ignoreCase) {
      -        ignoreCase = true;
      -      } else if (/[a-z]/i.test(regex.source.replace(
      -                     /\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi, ''))) {
      -        needToFoldCase = true;
      -        ignoreCase = false;
      -        break;
      -      }
      -    }
      -
      -    function decodeEscape(charsetPart) {
      -      if (charsetPart.charAt(0) !== '\\') { return charsetPart.charCodeAt(0); }
      -      switch (charsetPart.charAt(1)) {
      -        case 'b': return 8;
      -        case 't': return 9;
      -        case 'n': return 0xa;
      -        case 'v': return 0xb;
      -        case 'f': return 0xc;
      -        case 'r': return 0xd;
      -        case 'u': case 'x':
      -          return parseInt(charsetPart.substring(2), 16)
      -              || charsetPart.charCodeAt(1);
      -        case '0': case '1': case '2': case '3': case '4':
      -        case '5': case '6': case '7':
      -          return parseInt(charsetPart.substring(1), 8);
      -        default: return charsetPart.charCodeAt(1);
      -      }
      -    }
      -
      -    function encodeEscape(charCode) {
      -      if (charCode < 0x20) {
      -        return (charCode < 0x10 ? '\\x0' : '\\x') + charCode.toString(16);
      -      }
      -      var ch = String.fromCharCode(charCode);
      -      if (ch === '\\' || ch === '-' || ch === '[' || ch === ']') {
      -        ch = '\\' + ch;
      -      }
      -      return ch;
      -    }
      -
      -    function caseFoldCharset(charSet) {
      -      var charsetParts = charSet.substring(1, charSet.length - 1).match(
      -          new RegExp(
      -              '\\\\u[0-9A-Fa-f]{4}'
      -              + '|\\\\x[0-9A-Fa-f]{2}'
      -              + '|\\\\[0-3][0-7]{0,2}'
      -              + '|\\\\[0-7]{1,2}'
      -              + '|\\\\[\\s\\S]'
      -              + '|-'
      -              + '|[^-\\\\]',
      -              'g'));
      -      var groups = [];
      -      var ranges = [];
      -      var inverse = charsetParts[0] === '^';
      -      for (var i = inverse ? 1 : 0, n = charsetParts.length; i < n; ++i) {
      -        var p = charsetParts[i];
      -        switch (p) {
      -          case '\\B': case '\\b':
      -          case '\\D': case '\\d':
      -          case '\\S': case '\\s':
      -          case '\\W': case '\\w':
      -            groups.push(p);
      -            continue;
      -        }
      -        var start = decodeEscape(p);
      -        var end;
      -        if (i + 2 < n && '-' === charsetParts[i + 1]) {
      -          end = decodeEscape(charsetParts[i + 2]);
      -          i += 2;
      -        } else {
      -          end = start;
      -        }
      -        ranges.push([start, end]);
      -        // If the range might intersect letters, then expand it.
      -        if (!(end < 65 || start > 122)) {
      -          if (!(end < 65 || start > 90)) {
      -            ranges.push([Math.max(65, start) | 32, Math.min(end, 90) | 32]);
      -          }
      -          if (!(end < 97 || start > 122)) {
      -            ranges.push([Math.max(97, start) & ~32, Math.min(end, 122) & ~32]);
      -          }
      -        }
      -      }
      -
      -      // [[1, 10], [3, 4], [8, 12], [14, 14], [16, 16], [17, 17]]
      -      // -> [[1, 12], [14, 14], [16, 17]]
      -      ranges.sort(function (a, b) { return (a[0] - b[0]) || (b[1]  - a[1]); });
      -      var consolidatedRanges = [];
      -      var lastRange = [NaN, NaN];
      -      for (var i = 0; i < ranges.length; ++i) {
      -        var range = ranges[i];
      -        if (range[0] <= lastRange[1] + 1) {
      -          lastRange[1] = Math.max(lastRange[1], range[1]);
      -        } else {
      -          consolidatedRanges.push(lastRange = range);
      -        }
      -      }
      -
      -      var out = ['['];
      -      if (inverse) { out.push('^'); }
      -      out.push.apply(out, groups);
      -      for (var i = 0; i < consolidatedRanges.length; ++i) {
      -        var range = consolidatedRanges[i];
      -        out.push(encodeEscape(range[0]));
      -        if (range[1] > range[0]) {
      -          if (range[1] + 1 > range[0]) { out.push('-'); }
      -          out.push(encodeEscape(range[1]));
      -        }
      -      }
      -      out.push(']');
      -      return out.join('');
      -    }
      -
      -    function allowAnywhereFoldCaseAndRenumberGroups(regex) {
      -      // Split into character sets, escape sequences, punctuation strings
      -      // like ('(', '(?:', ')', '^'), and runs of characters that do not
      -      // include any of the above.
      -      var parts = regex.source.match(
      -          new RegExp(
      -              '(?:'
      -              + '\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]'  // a character set
      -              + '|\\\\u[A-Fa-f0-9]{4}'  // a unicode escape
      -              + '|\\\\x[A-Fa-f0-9]{2}'  // a hex escape
      -              + '|\\\\[0-9]+'  // a back-reference or octal escape
      -              + '|\\\\[^ux0-9]'  // other escape sequence
      -              + '|\\(\\?[:!=]'  // start of a non-capturing group
      -              + '|[\\(\\)\\^]'  // start/emd of a group, or line start
      -              + '|[^\\x5B\\x5C\\(\\)\\^]+'  // run of other characters
      -              + ')',
      -              'g'));
      -      var n = parts.length;
      -
      -      // Maps captured group numbers to the number they will occupy in
      -      // the output or to -1 if that has not been determined, or to
      -      // undefined if they need not be capturing in the output.
      -      var capturedGroups = [];
      -
      -      // Walk over and identify back references to build the capturedGroups
      -      // mapping.
      -      for (var i = 0, groupIndex = 0; i < n; ++i) {
      -        var p = parts[i];
      -        if (p === '(') {
      -          // groups are 1-indexed, so max group index is count of '('
      -          ++groupIndex;
      -        } else if ('\\' === p.charAt(0)) {
      -          var decimalValue = +p.substring(1);
      -          if (decimalValue && decimalValue <= groupIndex) {
      -            capturedGroups[decimalValue] = -1;
      -          }
      -        }
      -      }
      -
      -      // Renumber groups and reduce capturing groups to non-capturing groups
      -      // where possible.
      -      for (var i = 1; i < capturedGroups.length; ++i) {
      -        if (-1 === capturedGroups[i]) {
      -          capturedGroups[i] = ++capturedGroupIndex;
      -        }
      -      }
      -      for (var i = 0, groupIndex = 0; i < n; ++i) {
      -        var p = parts[i];
      -        if (p === '(') {
      -          ++groupIndex;
      -          if (capturedGroups[groupIndex] === undefined) {
      -            parts[i] = '(?:';
      -          }
      -        } else if ('\\' === p.charAt(0)) {
      -          var decimalValue = +p.substring(1);
      -          if (decimalValue && decimalValue <= groupIndex) {
      -            parts[i] = '\\' + capturedGroups[groupIndex];
      -          }
      -        }
      -      }
      -
      -      // Remove any prefix anchors so that the output will match anywhere.
      -      // ^^ really does mean an anchored match though.
      -      for (var i = 0, groupIndex = 0; i < n; ++i) {
      -        if ('^' === parts[i] && '^' !== parts[i + 1]) { parts[i] = ''; }
      -      }
      -
      -      // Expand letters to groupts to handle mixing of case-sensitive and
      -      // case-insensitive patterns if necessary.
      -      if (regex.ignoreCase && needToFoldCase) {
      -        for (var i = 0; i < n; ++i) {
      -          var p = parts[i];
      -          var ch0 = p.charAt(0);
      -          if (p.length >= 2 && ch0 === '[') {
      -            parts[i] = caseFoldCharset(p);
      -          } else if (ch0 !== '\\') {
      -            // TODO: handle letters in numeric escapes.
      -            parts[i] = p.replace(
      -                /[a-zA-Z]/g,
      -                function (ch) {
      -                  var cc = ch.charCodeAt(0);
      -                  return '[' + String.fromCharCode(cc & ~32, cc | 32) + ']';
      -                });
      -          }
      -        }
      -      }
      -
      -      return parts.join('');
      -    }
      -
      -    var rewritten = [];
      -    for (var i = 0, n = regexs.length; i < n; ++i) {
      -      var regex = regexs[i];
      -      if (regex.global || regex.multiline) { throw new Error('' + regex); }
      -      rewritten.push(
      -          '(?:' + allowAnywhereFoldCaseAndRenumberGroups(regex) + ')');
      -    }
      -
      -    return new RegExp(rewritten.join('|'), ignoreCase ? 'gi' : 'g');
      -  }
      -
      -  var PR_innerHtmlWorks = null;
      -  function getInnerHtml(node) {
      -    // inner html is hopelessly broken in Safari 2.0.4 when the content is
      -    // an html description of well formed XML and the containing tag is a PRE
      -    // tag, so we detect that case and emulate innerHTML.
      -    if (null === PR_innerHtmlWorks) {
      -      var testNode = document.createElement('PRE');
      -      testNode.appendChild(
      -          document.createTextNode('<!DOCTYPE foo PUBLIC "foo bar">\n<foo />'));
      -      PR_innerHtmlWorks = !/</.test(testNode.innerHTML);
      -    }
      -
      -    if (PR_innerHtmlWorks) {
      -      var content = node.innerHTML;
      -      // XMP tags contain unescaped entities so require special handling.
      -      if (isRawContent(node)) {
      -        content = textToHtml(content);
      -      } else if (!isPreformatted(node, content)) {
      -        content = content.replace(/(<br\s*\/?>)[\r\n]+/g, '$1')
      -            .replace(/(?:[\r\n]+[ \t]*)+/g, ' ');
      -      }
      -      return content;
      -    }
      -
      -    var out = [];
      -    for (var child = node.firstChild; child; child = child.nextSibling) {
      -      normalizedHtml(child, out);
      -    }
      -    return out.join('');
      -  }
      -
      -  /** returns a function that expand tabs to spaces.  This function can be fed
      -    * successive chunks of text, and will maintain its own internal state to
      -    * keep track of how tabs are expanded.
      -    * @return {function (string) : string} a function that takes
      -    *   plain text and return the text with tabs expanded.
      -    * @private
      -    */
      -  function makeTabExpander(tabWidth) {
      -    var SPACES = '                ';
      -    var charInLine = 0;
      -
      -    return function (plainText) {
      -      // walk over each character looking for tabs and newlines.
      -      // On tabs, expand them.  On newlines, reset charInLine.
      -      // Otherwise increment charInLine
      -      var out = null;
      -      var pos = 0;
      -      for (var i = 0, n = plainText.length; i < n; ++i) {
      -        var ch = plainText.charAt(i);
      -
      -        switch (ch) {
      -          case '\t':
      -            if (!out) { out = []; }
      -            out.push(plainText.substring(pos, i));
      -            // calculate how much space we need in front of this part
      -            // nSpaces is the amount of padding -- the number of spaces needed
      -            // to move us to the next column, where columns occur at factors of
      -            // tabWidth.
      -            var nSpaces = tabWidth - (charInLine % tabWidth);
      -            charInLine += nSpaces;
      -            for (; nSpaces >= 0; nSpaces -= SPACES.length) {
      -              out.push(SPACES.substring(0, nSpaces));
      -            }
      -            pos = i + 1;
      -            break;
      -          case '\n':
      -            charInLine = 0;
      -            break;
      -          default:
      -            ++charInLine;
      -        }
      -      }
      -      if (!out) { return plainText; }
      -      out.push(plainText.substring(pos));
      -      return out.join('');
      -    };
      -  }
      -
      -  var pr_chunkPattern = new RegExp(
      -      '[^<]+'  // A run of characters other than '<'
      -      + '|<\!--[\\s\\S]*?--\>'  // an HTML comment
      -      + '|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>'  // a CDATA section
      -      // a probable tag that should not be highlighted
      -      + '|<\/?[a-zA-Z](?:[^>\"\']|\'[^\']*\'|\"[^\"]*\")*>'
      -      + '|<',  // A '<' that does not begin a larger chunk
      -      'g');
      -  var pr_commentPrefix = /^<\!--/;
      -  var pr_cdataPrefix = /^<!\[CDATA\[/;
      -  var pr_brPrefix = /^<br\b/i;
      -  var pr_tagNameRe = /^<(\/?)([a-zA-Z][a-zA-Z0-9]*)/;
      -
      -  /** split markup into chunks of html tags (style null) and
      -    * plain text (style {@link #PR_PLAIN}), converting tags which are
      -    * significant for tokenization (<br>) into their textual equivalent.
      -    *
      -    * @param {string} s html where whitespace is considered significant.
      -    * @return {Object} source code and extracted tags.
      -    * @private
      -    */
      -  function extractTags(s) {
      -    // since the pattern has the 'g' modifier and defines no capturing groups,
      -    // this will return a list of all chunks which we then classify and wrap as
      -    // PR_Tokens
      -    var matches = s.match(pr_chunkPattern);
      -    var sourceBuf = [];
      -    var sourceBufLen = 0;
      -    var extractedTags = [];
      -    if (matches) {
      -      for (var i = 0, n = matches.length; i < n; ++i) {
      -        var match = matches[i];
      -        if (match.length > 1 && match.charAt(0) === '<') {
      -          if (pr_commentPrefix.test(match)) { continue; }
      -          if (pr_cdataPrefix.test(match)) {
      -            // strip CDATA prefix and suffix.  Don't unescape since it's CDATA
      -            sourceBuf.push(match.substring(9, match.length - 3));
      -            sourceBufLen += match.length - 12;
      -          } else if (pr_brPrefix.test(match)) {
      -            // <br> tags are lexically significant so convert them to text.
      -            // This is undone later.
      -            sourceBuf.push('\n');
      -            ++sourceBufLen;
      -          } else {
      -            if (match.indexOf(PR_NOCODE) >= 0 && isNoCodeTag(match)) {
      -              // A <span class="nocode"> will start a section that should be
      -              // ignored.  Continue walking the list until we see a matching end
      -              // tag.
      -              var name = match.match(pr_tagNameRe)[2];
      -              var depth = 1;
      -              var j;
      -              end_tag_loop:
      -              for (j = i + 1; j < n; ++j) {
      -                var name2 = matches[j].match(pr_tagNameRe);
      -                if (name2 && name2[2] === name) {
      -                  if (name2[1] === '/') {
      -                    if (--depth === 0) { break end_tag_loop; }
      -                  } else {
      -                    ++depth;
      -                  }
      -                }
      -              }
      -              if (j < n) {
      -                extractedTags.push(
      -                    sourceBufLen, matches.slice(i, j + 1).join(''));
      -                i = j;
      -              } else {  // Ignore unclosed sections.
      -                extractedTags.push(sourceBufLen, match);
      -              }
      -            } else {
      -              extractedTags.push(sourceBufLen, match);
      -            }
      -          }
      -        } else {
      -          var literalText = htmlToText(match);
      -          sourceBuf.push(literalText);
      -          sourceBufLen += literalText.length;
      -        }
      -      }
      -    }
      -    return { source: sourceBuf.join(''), tags: extractedTags };
      -  }
      -
      -  /** True if the given tag contains a class attribute with the nocode class. */
      -  function isNoCodeTag(tag) {
      -    return !!tag
      -        // First canonicalize the representation of attributes
      -        .replace(/\s(\w+)\s*=\s*(?:\"([^\"]*)\"|'([^\']*)'|(\S+))/g,
      -                 ' $1="$2$3$4"')
      -        // Then look for the attribute we want.
      -        .match(/[cC][lL][aA][sS][sS]=\"[^\"]*\bnocode\b/);
      -  }
      -
      -  /**
      -   * Apply the given language handler to sourceCode and add the resulting
      -   * decorations to out.
      -   * @param {number} basePos the index of sourceCode within the chunk of source
      -   *    whose decorations are already present on out.
      -   */
      -  function appendDecorations(basePos, sourceCode, langHandler, out) {
      -    if (!sourceCode) { return; }
      -    var job = {
      -      source: sourceCode,
      -      basePos: basePos
      -    };
      -    langHandler(job);
      -    out.push.apply(out, job.decorations);
      -  }
      -
      -  /** Given triples of [style, pattern, context] returns a lexing function,
      -    * The lexing function interprets the patterns to find token boundaries and
      -    * returns a decoration list of the form
      -    * [index_0, style_0, index_1, style_1, ..., index_n, style_n]
      -    * where index_n is an index into the sourceCode, and style_n is a style
      -    * constant like PR_PLAIN.  index_n-1 <= index_n, and style_n-1 applies to
      -    * all characters in sourceCode[index_n-1:index_n].
      -    *
      -    * The stylePatterns is a list whose elements have the form
      -    * [style : string, pattern : RegExp, DEPRECATED, shortcut : string].
      -    *
      -    * Style is a style constant like PR_PLAIN, or can be a string of the
      -    * form 'lang-FOO', where FOO is a language extension describing the
      -    * language of the portion of the token in $1 after pattern executes.
      -    * E.g., if style is 'lang-lisp', and group 1 contains the text
      -    * '(hello (world))', then that portion of the token will be passed to the
      -    * registered lisp handler for formatting.
      -    * The text before and after group 1 will be restyled using this decorator
      -    * so decorators should take care that this doesn't result in infinite
      -    * recursion.  For example, the HTML lexer rule for SCRIPT elements looks
      -    * something like ['lang-js', /<[s]cript>(.+?)<\/script>/].  This may match
      -    * '<script>foo()<\/script>', which would cause the current decorator to
      -    * be called with '<script>' which would not match the same rule since
      -    * group 1 must not be empty, so it would be instead styled as PR_TAG by
      -    * the generic tag rule.  The handler registered for the 'js' extension would
      -    * then be called with 'foo()', and finally, the current decorator would
      -    * be called with '<\/script>' which would not match the original rule and
      -    * so the generic tag rule would identify it as a tag.
      -    *
      -    * Pattern must only match prefixes, and if it matches a prefix, then that
      -    * match is considered a token with the same style.
      -    *
      -    * Context is applied to the last non-whitespace, non-comment token
      -    * recognized.
      -    *
      -    * Shortcut is an optional string of characters, any of which, if the first
      -    * character, gurantee that this pattern and only this pattern matches.
      -    *
      -    * @param {Array} shortcutStylePatterns patterns that always start with
      -    *   a known character.  Must have a shortcut string.
      -    * @param {Array} fallthroughStylePatterns patterns that will be tried in
      -    *   order if the shortcut ones fail.  May have shortcuts.
      -    *
      -    * @return {function (Object)} a
      -    *   function that takes source code and returns a list of decorations.
      -    */
      -  function createSimpleLexer(shortcutStylePatterns, fallthroughStylePatterns) {
      -    var shortcuts = {};
      -    var tokenizer;
      -    (function () {
      -      var allPatterns = shortcutStylePatterns.concat(fallthroughStylePatterns);
      -      var allRegexs = [];
      -      var regexKeys = {};
      -      for (var i = 0, n = allPatterns.length; i < n; ++i) {
      -        var patternParts = allPatterns[i];
      -        var shortcutChars = patternParts[3];
      -        if (shortcutChars) {
      -          for (var c = shortcutChars.length; --c >= 0;) {
      -            shortcuts[shortcutChars.charAt(c)] = patternParts;
      -          }
      -        }
      -        var regex = patternParts[1];
      -        var k = '' + regex;
      -        if (!regexKeys.hasOwnProperty(k)) {
      -          allRegexs.push(regex);
      -          regexKeys[k] = null;
      -        }
      -      }
      -      allRegexs.push(/[\0-\uffff]/);
      -      tokenizer = combinePrefixPatterns(allRegexs);
      -    })();
      -
      -    var nPatterns = fallthroughStylePatterns.length;
      -    var notWs = /\S/;
      -
      -    /**
      -     * Lexes job.source and produces an output array job.decorations of style
      -     * classes preceded by the position at which they start in job.source in
      -     * order.
      -     *
      -     * @param {Object} job an object like {@code
      -     *    source: {string} sourceText plain text,
      -     *    basePos: {int} position of job.source in the larger chunk of
      -     *        sourceCode.
      -     * }
      -     */
      -    var decorate = function (job) {
      -      var sourceCode = job.source, basePos = job.basePos;
      -      /** Even entries are positions in source in ascending order.  Odd enties
      -        * are style markers (e.g., PR_COMMENT) that run from that position until
      -        * the end.
      -        * @type {Array.<number|string>}
      -        */
      -      var decorations = [basePos, PR_PLAIN];
      -      var pos = 0;  // index into sourceCode
      -      var tokens = sourceCode.match(tokenizer) || [];
      -      var styleCache = {};
      -
      -      for (var ti = 0, nTokens = tokens.length; ti < nTokens; ++ti) {
      -        var token = tokens[ti];
      -        var style = styleCache[token];
      -        var match = void 0;
      -
      -        var isEmbedded;
      -        if (typeof style === 'string') {
      -          isEmbedded = false;
      -        } else {
      -          var patternParts = shortcuts[token.charAt(0)];
      -          if (patternParts) {
      -            match = token.match(patternParts[1]);
      -            style = patternParts[0];
      -          } else {
      -            for (var i = 0; i < nPatterns; ++i) {
      -              patternParts = fallthroughStylePatterns[i];
      -              match = token.match(patternParts[1]);
      -              if (match) {
      -                style = patternParts[0];
      -                break;
      -              }
      -            }
      -
      -            if (!match) {  // make sure that we make progress
      -              style = PR_PLAIN;
      -            }
      -          }
      -
      -          isEmbedded = style.length >= 5 && 'lang-' === style.substring(0, 5);
      -          if (isEmbedded && !(match && typeof match[1] === 'string')) {
      -            isEmbedded = false;
      -            style = PR_SOURCE;
      -          }
      -
      -          if (!isEmbedded) { styleCache[token] = style; }
      -        }
      -
      -        var tokenStart = pos;
      -        pos += token.length;
      -
      -        if (!isEmbedded) {
      -          decorations.push(basePos + tokenStart, style);
      -        } else {  // Treat group 1 as an embedded block of source code.
      -          var embeddedSource = match[1];
      -          var embeddedSourceStart = token.indexOf(embeddedSource);
      -          var embeddedSourceEnd = embeddedSourceStart + embeddedSource.length;
      -          if (match[2]) {
      -            // If embeddedSource can be blank, then it would match at the
      -            // beginning which would cause us to infinitely recurse on the
      -            // entire token, so we catch the right context in match[2].
      -            embeddedSourceEnd = token.length - match[2].length;
      -            embeddedSourceStart = embeddedSourceEnd - embeddedSource.length;
      -          }
      -          var lang = style.substring(5);
      -          // Decorate the left of the embedded source
      -          appendDecorations(
      -              basePos + tokenStart,
      -              token.substring(0, embeddedSourceStart),
      -              decorate, decorations);
      -          // Decorate the embedded source
      -          appendDecorations(
      -              basePos + tokenStart + embeddedSourceStart,
      -              embeddedSource,
      -              langHandlerForExtension(lang, embeddedSource),
      -              decorations);
      -          // Decorate the right of the embedded section
      -          appendDecorations(
      -              basePos + tokenStart + embeddedSourceEnd,
      -              token.substring(embeddedSourceEnd),
      -              decorate, decorations);
      -        }
      -      }
      -      job.decorations = decorations;
      -    };
      -    return decorate;
      -  }
      -
      -  /** returns a function that produces a list of decorations from source text.
      -    *
      -    * This code treats ", ', and ` as string delimiters, and \ as a string
      -    * escape.  It does not recognize perl's qq() style strings.
      -    * It has no special handling for double delimiter escapes as in basic, or
      -    * the tripled delimiters used in python, but should work on those regardless
      -    * although in those cases a single string literal may be broken up into
      -    * multiple adjacent string literals.
      -    *
      -    * It recognizes C, C++, and shell style comments.
      -    *
      -    * @param {Object} options a set of optional parameters.
      -    * @return {function (Object)} a function that examines the source code
      -    *     in the input job and builds the decoration list.
      -    */
      -  function sourceDecorator(options) {
      -    var shortcutStylePatterns = [], fallthroughStylePatterns = [];
      -    if (options['tripleQuotedStrings']) {
      -      // '''multi-line-string''', 'single-line-string', and double-quoted
      -      shortcutStylePatterns.push(
      -          [PR_STRING,  /^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,
      -           null, '\'"']);
      -    } else if (options['multiLineStrings']) {
      -      // 'multi-line-string', "multi-line-string"
      -      shortcutStylePatterns.push(
      -          [PR_STRING,  /^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,
      -           null, '\'"`']);
      -    } else {
      -      // 'single-line-string', "single-line-string"
      -      shortcutStylePatterns.push(
      -          [PR_STRING,
      -           /^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,
      -           null, '"\'']);
      -    }
      -    if (options['verbatimStrings']) {
      -      // verbatim-string-literal production from the C# grammar.  See issue 93.
      -      fallthroughStylePatterns.push(
      -          [PR_STRING, /^@\"(?:[^\"]|\"\")*(?:\"|$)/, null]);
      -    }
      -    if (options['hashComments']) {
      -      if (options['cStyleComments']) {
      -        // Stop C preprocessor declarations at an unclosed open comment
      -        shortcutStylePatterns.push(
      -            [PR_COMMENT, /^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\r\n]*)/,
      -             null, '#']);
      -        fallthroughStylePatterns.push(
      -            [PR_STRING,
      -             /^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/,
      -             null]);
      -      } else {
      -        shortcutStylePatterns.push([PR_COMMENT, /^#[^\r\n]*/, null, '#']);
      -      }
      -    }
      -    if (options['cStyleComments']) {
      -      fallthroughStylePatterns.push([PR_COMMENT, /^\/\/[^\r\n]*/, null]);
      -      fallthroughStylePatterns.push(
      -          [PR_COMMENT, /^\/\*[\s\S]*?(?:\*\/|$)/, null]);
      -    }
      -    if (options['regexLiterals']) {
      -      var REGEX_LITERAL = (
      -          // A regular expression literal starts with a slash that is
      -          // not followed by * or / so that it is not confused with
      -          // comments.
      -          '/(?=[^/*])'
      -          // and then contains any number of raw characters,
      -          + '(?:[^/\\x5B\\x5C]'
      -          // escape sequences (\x5C),
      -          +    '|\\x5C[\\s\\S]'
      -          // or non-nesting character sets (\x5B\x5D);
      -          +    '|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+'
      -          // finally closed by a /.
      -          + '/');
      -      fallthroughStylePatterns.push(
      -          ['lang-regex',
      -           new RegExp('^' + REGEXP_PRECEDER_PATTERN + '(' + REGEX_LITERAL + ')')
      -           ]);
      -    }
      -
      -    var keywords = options['keywords'].replace(/^\s+|\s+$/g, '');
      -    if (keywords.length) {
      -      fallthroughStylePatterns.push(
      -          [PR_KEYWORD,
      -           new RegExp('^(?:' + keywords.replace(/\s+/g, '|') + ')\\b'), null]);
      -    }
      -
      -    shortcutStylePatterns.push([PR_PLAIN,       /^\s+/, null, ' \r\n\t\xA0']);
      -    fallthroughStylePatterns.push(
      -        // TODO(mikesamuel): recognize non-latin letters and numerals in idents
      -        [PR_LITERAL,     /^@[a-z_$][a-z_$@0-9]*/i, null],
      -        [PR_TYPE,        /^@?[A-Z]+[a-z][A-Za-z_$@0-9]*/, null],
      -        [PR_PLAIN,       /^[a-z_$][a-z_$@0-9]*/i, null],
      -        [PR_LITERAL,
      -         new RegExp(
      -             '^(?:'
      -             // A hex number
      -             + '0x[a-f0-9]+'
      -             // or an octal or decimal number,
      -             + '|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)'
      -             // possibly in scientific notation
      -             + '(?:e[+\\-]?\\d+)?'
      -             + ')'
      -             // with an optional modifier like UL for unsigned long
      -             + '[a-z]*', 'i'),
      -         null, '0123456789'],
      -        [PR_PUNCTUATION, /^.[^\s\w\.$@\'\"\`\/\#]*/, null]);
      -
      -    return createSimpleLexer(shortcutStylePatterns, fallthroughStylePatterns);
      -  }
      -
      -  var decorateSource = sourceDecorator({
      -        'keywords': ALL_KEYWORDS,
      -        'hashComments': true,
      -        'cStyleComments': true,
      -        'multiLineStrings': true,
      -        'regexLiterals': true
      -      });
      -
      -  /** Breaks {@code job.source} around style boundaries in
      -    * {@code job.decorations} while re-interleaving {@code job.extractedTags},
      -    * and leaves the result in {@code job.prettyPrintedHtml}.
      -    * @param {Object} job like {
      -    *    source: {string} source as plain text,
      -    *    extractedTags: {Array.<number|string>} extractedTags chunks of raw
      -    *                   html preceded by their position in {@code job.source}
      -    *                   in order
      -    *    decorations: {Array.<number|string} an array of style classes preceded
      -    *                 by the position at which they start in job.source in order
      -    * }
      -    * @private
      -    */
      -  function recombineTagsAndDecorations(job) {
      -    var sourceText = job.source;
      -    var extractedTags = job.extractedTags;
      -    var decorations = job.decorations;
      -
      -    var html = [];
      -    // index past the last char in sourceText written to html
      -    var outputIdx = 0;
      -
      -    var openDecoration = null;
      -    var currentDecoration = null;
      -    var tagPos = 0;  // index into extractedTags
      -    var decPos = 0;  // index into decorations
      -    var tabExpander = makeTabExpander(window['PR_TAB_WIDTH']);
      -
      -    var adjacentSpaceRe = /([\r\n ]) /g;
      -    var startOrSpaceRe = /(^| ) /gm;
      -    var newlineRe = /\r\n?|\n/g;
      -    var trailingSpaceRe = /[ \r\n]$/;
      -    var lastWasSpace = true;  // the last text chunk emitted ended with a space.
      -
      -    // A helper function that is responsible for opening sections of decoration
      -    // and outputing properly escaped chunks of source
      -    function emitTextUpTo(sourceIdx) {
      -      if (sourceIdx > outputIdx) {
      -        if (openDecoration && openDecoration !== currentDecoration) {
      -          // Close the current decoration
      -          html.push('</span>');
      -          openDecoration = null;
      -        }
      -        if (!openDecoration && currentDecoration) {
      -          openDecoration = currentDecoration;
      -          html.push('<span class="', openDecoration, '">');
      -        }
      -        // This interacts badly with some wikis which introduces paragraph tags
      -        // into pre blocks for some strange reason.
      -        // It's necessary for IE though which seems to lose the preformattedness
      -        // of <pre> tags when their innerHTML is assigned.
      -        // http://stud3.tuwien.ac.at/~e0226430/innerHtmlQuirk.html
      -        // and it serves to undo the conversion of <br>s to newlines done in
      -        // chunkify.
      -        var htmlChunk = textToHtml(
      -            tabExpander(sourceText.substring(outputIdx, sourceIdx)))
      -            .replace(lastWasSpace
      -                     ? startOrSpaceRe
      -                     : adjacentSpaceRe, '$1&nbsp;');
      -        // Keep track of whether we need to escape space at the beginning of the
      -        // next chunk.
      -        lastWasSpace = trailingSpaceRe.test(htmlChunk);
      -        // IE collapses multiple adjacient <br>s into 1 line break.
      -        // Prefix every <br> with '&nbsp;' can prevent such IE's behavior.
      -        var lineBreakHtml = window['_pr_isIE6']() ? '&nbsp;<br />' : '<br />';
      -        html.push(htmlChunk.replace(newlineRe, lineBreakHtml));
      -        outputIdx = sourceIdx;
      -      }
      -    }
      -
      -    while (true) {
      -      // Determine if we're going to consume a tag this time around.  Otherwise
      -      // we consume a decoration or exit.
      -      var outputTag;
      -      if (tagPos < extractedTags.length) {
      -        if (decPos < decorations.length) {
      -          // Pick one giving preference to extractedTags since we shouldn't open
      -          // a new style that we're going to have to immediately close in order
      -          // to output a tag.
      -          outputTag = extractedTags[tagPos] <= decorations[decPos];
      -        } else {
      -          outputTag = true;
      -        }
      -      } else {
      -        outputTag = false;
      -      }
      -      // Consume either a decoration or a tag or exit.
      -      if (outputTag) {
      -        emitTextUpTo(extractedTags[tagPos]);
      -        if (openDecoration) {
      -          // Close the current decoration
      -          html.push('</span>');
      -          openDecoration = null;
      -        }
      -        html.push(extractedTags[tagPos + 1]);
      -        tagPos += 2;
      -      } else if (decPos < decorations.length) {
      -        emitTextUpTo(decorations[decPos]);
      -        currentDecoration = decorations[decPos + 1];
      -        decPos += 2;
      -      } else {
      -        break;
      -      }
      -    }
      -    emitTextUpTo(sourceText.length);
      -    if (openDecoration) {
      -      html.push('</span>');
      -    }
      -    job.prettyPrintedHtml = html.join('');
      -  }
      -
      -  /** Maps language-specific file extensions to handlers. */
      -  var langHandlerRegistry = {};
      -  /** Register a language handler for the given file extensions.
      -    * @param {function (Object)} handler a function from source code to a list
      -    *      of decorations.  Takes a single argument job which describes the
      -    *      state of the computation.   The single parameter has the form
      -    *      {@code {
      -    *        source: {string} as plain text.
      -    *        decorations: {Array.<number|string>} an array of style classes
      -    *                     preceded by the position at which they start in
      -    *                     job.source in order.
      -    *                     The language handler should assigned this field.
      -    *        basePos: {int} the position of source in the larger source chunk.
      -    *                 All positions in the output decorations array are relative
      -    *                 to the larger source chunk.
      -    *      } }
      -    * @param {Array.<string>} fileExtensions
      -    */
      -  function registerLangHandler(handler, fileExtensions) {
      -    for (var i = fileExtensions.length; --i >= 0;) {
      -      var ext = fileExtensions[i];
      -      if (!langHandlerRegistry.hasOwnProperty(ext)) {
      -        langHandlerRegistry[ext] = handler;
      -      } else if ('console' in window) {
      -        console.warn('cannot override language handler %s', ext);
      -      }
      -    }
      -  }
      -  function langHandlerForExtension(extension, source) {
      -    if (!(extension && langHandlerRegistry.hasOwnProperty(extension))) {
      -      // Treat it as markup if the first non whitespace character is a < and
      -      // the last non-whitespace character is a >.
      -      extension = /^\s*</.test(source)
      -          ? 'default-markup'
      -          : 'default-code';
      -    }
      -    return langHandlerRegistry[extension];
      -  }
      -  registerLangHandler(decorateSource, ['default-code']);
      -  registerLangHandler(
      -      createSimpleLexer(
      -          [],
      -          [
      -           [PR_PLAIN,       /^[^<?]+/],
      -           [PR_DECLARATION, /^<!\w[^>]*(?:>|$)/],
      -           [PR_COMMENT,     /^<\!--[\s\S]*?(?:-\->|$)/],
      -           // Unescaped content in an unknown language
      -           ['lang-',        /^<\?([\s\S]+?)(?:\?>|$)/],
      -           ['lang-',        /^<%([\s\S]+?)(?:%>|$)/],
      -           [PR_PUNCTUATION, /^(?:<[%?]|[%?]>)/],
      -           ['lang-',        /^<xmp\b[^>]*>([\s\S]+?)<\/xmp\b[^>]*>/i],
      -           // Unescaped content in javascript.  (Or possibly vbscript).
      -           ['lang-js',      /^<script\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],
      -           // Contains unescaped stylesheet content
      -           ['lang-css',     /^<style\b[^>]*>([\s\S]*?)(<\/style\b[^>]*>)/i],
      -           ['lang-in.tag',  /^(<\/?[a-z][^<>]*>)/i]
      -          ]),
      -      ['default-markup', 'htm', 'html', 'mxml', 'xhtml', 'xml', 'xsl']);
      -  registerLangHandler(
      -      createSimpleLexer(
      -          [
      -           [PR_PLAIN,        /^[\s]+/, null, ' \t\r\n'],
      -           [PR_ATTRIB_VALUE, /^(?:\"[^\"]*\"?|\'[^\']*\'?)/, null, '\"\'']
      -           ],
      -          [
      -           [PR_TAG,          /^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],
      -           [PR_ATTRIB_NAME,  /^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],
      -           ['lang-uq.val',   /^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],
      -           [PR_PUNCTUATION,  /^[=<>\/]+/],
      -           ['lang-js',       /^on\w+\s*=\s*\"([^\"]+)\"/i],
      -           ['lang-js',       /^on\w+\s*=\s*\'([^\']+)\'/i],
      -           ['lang-js',       /^on\w+\s*=\s*([^\"\'>\s]+)/i],
      -           ['lang-css',      /^style\s*=\s*\"([^\"]+)\"/i],
      -           ['lang-css',      /^style\s*=\s*\'([^\']+)\'/i],
      -           ['lang-css',      /^style\s*=\s*([^\"\'>\s]+)/i]
      -           ]),
      -      ['in.tag']);
      -  registerLangHandler(
      -      createSimpleLexer([], [[PR_ATTRIB_VALUE, /^[\s\S]+/]]), ['uq.val']);
      -  registerLangHandler(sourceDecorator({
      -          'keywords': CPP_KEYWORDS,
      -          'hashComments': true,
      -          'cStyleComments': true
      -        }), ['c', 'cc', 'cpp', 'cxx', 'cyc', 'm']);
      -  registerLangHandler(sourceDecorator({
      -          'keywords': 'null true false'
      -        }), ['json']);
      -  registerLangHandler(sourceDecorator({
      -          'keywords': CSHARP_KEYWORDS,
      -          'hashComments': true,
      -          'cStyleComments': true,
      -          'verbatimStrings': true
      -        }), ['cs']);
      -  registerLangHandler(sourceDecorator({
      -          'keywords': JAVA_KEYWORDS,
      -          'cStyleComments': true
      -        }), ['java']);
      -  registerLangHandler(sourceDecorator({
      -          'keywords': SH_KEYWORDS,
      -          'hashComments': true,
      -          'multiLineStrings': true
      -        }), ['bsh', 'csh', 'sh']);
      -  registerLangHandler(sourceDecorator({
      -          'keywords': PYTHON_KEYWORDS,
      -          'hashComments': true,
      -          'multiLineStrings': true,
      -          'tripleQuotedStrings': true
      -        }), ['cv', 'py']);
      -  registerLangHandler(sourceDecorator({
      -          'keywords': PERL_KEYWORDS,
      -          'hashComments': true,
      -          'multiLineStrings': true,
      -          'regexLiterals': true
      -        }), ['perl', 'pl', 'pm']);
      -  registerLangHandler(sourceDecorator({
      -          'keywords': RUBY_KEYWORDS,
      -          'hashComments': true,
      -          'multiLineStrings': true,
      -          'regexLiterals': true
      -        }), ['rb']);
      -  registerLangHandler(sourceDecorator({
      -          'keywords': JSCRIPT_KEYWORDS,
      -          'cStyleComments': true,
      -          'regexLiterals': true
      -        }), ['js']);
      -  registerLangHandler(
      -      createSimpleLexer([], [[PR_STRING, /^[\s\S]+/]]), ['regex']);
      -
      -  function applyDecorator(job) {
      -    var sourceCodeHtml = job.sourceCodeHtml;
      -    var opt_langExtension = job.langExtension;
      -
      -    // Prepopulate output in case processing fails with an exception.
      -    job.prettyPrintedHtml = sourceCodeHtml;
      -
      -    try {
      -      // Extract tags, and convert the source code to plain text.
      -      var sourceAndExtractedTags = extractTags(sourceCodeHtml);
      -      /** Plain text. @type {string} */
      -      var source = sourceAndExtractedTags.source;
      -      job.source = source;
      -      job.basePos = 0;
      -
      -      /** Even entries are positions in source in ascending order.  Odd entries
      -        * are tags that were extracted at that position.
      -        * @type {Array.<number|string>}
      -        */
      -      job.extractedTags = sourceAndExtractedTags.tags;
      -
      -      // Apply the appropriate language handler
      -      langHandlerForExtension(opt_langExtension, source)(job);
      -      // Integrate the decorations and tags back into the source code to produce
      -      // a decorated html string which is left in job.prettyPrintedHtml.
      -      recombineTagsAndDecorations(job);
      -    } catch (e) {
      -      if ('console' in window) {
      -        console.log(e);
      -        console.trace();
      -      }
      -    }
      -  }
      -
      -  function prettyPrintOne(sourceCodeHtml, opt_langExtension) {
      -    var job = {
      -      sourceCodeHtml: sourceCodeHtml,
      -      langExtension: opt_langExtension
      -    };
      -    applyDecorator(job);
      -    return job.prettyPrintedHtml;
      -  }
      -
      -  function prettyPrint(opt_whenDone) {
      -    var isIE678 = window['_pr_isIE6']();
      -    var ieNewline = isIE678 === 6 ? '\r\n' : '\r';
      -    // See bug 71 and http://stackoverflow.com/questions/136443/why-doesnt-ie7-
      -
      -    // fetch a list of nodes to rewrite
      -    var codeSegments = [
      -        document.getElementsByTagName('pre'),
      -        document.getElementsByTagName('code'),
      -        document.getElementsByTagName('xmp') ];
      -    var elements = [];
      -    for (var i = 0; i < codeSegments.length; ++i) {
      -      for (var j = 0, n = codeSegments[i].length; j < n; ++j) {
      -        elements.push(codeSegments[i][j]);
      -      }
      -    }
      -    codeSegments = null;
      -
      -    var clock = Date;
      -    if (!clock['now']) {
      -      clock = { 'now': function () { return (new Date).getTime(); } };
      -    }
      -
      -    // The loop is broken into a series of continuations to make sure that we
      -    // don't make the browser unresponsive when rewriting a large page.
      -    var k = 0;
      -    var prettyPrintingJob;
      -
      -    function doWork() {
      -      var endTime = (window['PR_SHOULD_USE_CONTINUATION'] ?
      -                     clock.now() + 250 /* ms */ :
      -                     Infinity);
      -      for (; k < elements.length && clock.now() < endTime; k++) {
      -        var cs = elements[k];
      -        if (cs.className && cs.className.indexOf('prettyprint') >= 0) {
      -          // If the classes includes a language extensions, use it.
      -          // Language extensions can be specified like
      -          //     <pre class="prettyprint lang-cpp">
      -          // the language extension "cpp" is used to find a language handler as
      -          // passed to PR_registerLangHandler.
      -          var langExtension = cs.className.match(/\blang-(\w+)\b/);
      -          if (langExtension) { langExtension = langExtension[1]; }
      -
      -          // make sure this is not nested in an already prettified element
      -          var nested = false;
      -          for (var p = cs.parentNode; p; p = p.parentNode) {
      -            if ((p.tagName === 'pre' || p.tagName === 'code' ||
      -                 p.tagName === 'xmp') &&
      -                p.className && p.className.indexOf('prettyprint') >= 0) {
      -              nested = true;
      -              break;
      -            }
      -          }
      -          if (!nested) {
      -            // fetch the content as a snippet of properly escaped HTML.
      -            // Firefox adds newlines at the end.
      -            var content = getInnerHtml(cs);
      -            content = content.replace(/(?:\r\n?|\n)$/, '');
      -
      -            // do the pretty printing
      -            prettyPrintingJob = {
      -              sourceCodeHtml: content,
      -              langExtension: langExtension,
      -              sourceNode: cs
      -            };
      -            applyDecorator(prettyPrintingJob);
      -            replaceWithPrettyPrintedHtml();
      -          }
      -        }
      -      }
      -      if (k < elements.length) {
      -        // finish up in a continuation
      -        setTimeout(doWork, 250);
      -      } else if (opt_whenDone) {
      -        opt_whenDone();
      -      }
      -    }
      -
      -    function replaceWithPrettyPrintedHtml() {
      -      var newContent = prettyPrintingJob.prettyPrintedHtml;
      -      if (!newContent) { return; }
      -      var cs = prettyPrintingJob.sourceNode;
      -
      -      // push the prettified html back into the tag.
      -      if (!isRawContent(cs)) {
      -        // just replace the old html with the new
      -        cs.innerHTML = newContent;
      -      } else {
      -        // we need to change the tag to a <pre> since <xmp>s do not allow
      -        // embedded tags such as the span tags used to attach styles to
      -        // sections of source code.
      -        var pre = document.createElement('PRE');
      -        for (var i = 0; i < cs.attributes.length; ++i) {
      -          var a = cs.attributes[i];
      -          if (a.specified) {
      -            var aname = a.name.toLowerCase();
      -            if (aname === 'class') {
      -              pre.className = a.value;  // For IE 6
      -            } else {
      -              pre.setAttribute(a.name, a.value);
      -            }
      -          }
      -        }
      -        pre.innerHTML = newContent;
      -
      -        // remove the old
      -        cs.parentNode.replaceChild(pre, cs);
      -        cs = pre;
      -      }
      -
      -      // Replace <br>s with line-feeds so that copying and pasting works
      -      // on IE 6.
      -      // Doing this on other browsers breaks lots of stuff since \r\n is
      -      // treated as two newlines on Firefox, and doing this also slows
      -      // down rendering.
      -      if (isIE678 && cs.tagName === 'PRE') {
      -        var lineBreaks = cs.getElementsByTagName('br');
      -        for (var j = lineBreaks.length; --j >= 0;) {
      -          var lineBreak = lineBreaks[j];
      -          lineBreak.parentNode.replaceChild(
      -              document.createTextNode(ieNewline), lineBreak);
      -        }
      -      }
      -    }
      -
      -    doWork();
      -  }
      -
      -  window['PR_normalizedHtml'] = normalizedHtml;
      -  window['prettyPrintOne'] = prettyPrintOne;
      -  window['prettyPrint'] = prettyPrint;
      -  window['PR'] = {
      -        'combinePrefixPatterns': combinePrefixPatterns,
      -        'createSimpleLexer': createSimpleLexer,
      -        'registerLangHandler': registerLangHandler,
      -        'sourceDecorator': sourceDecorator,
      -        'PR_ATTRIB_NAME': PR_ATTRIB_NAME,
      -        'PR_ATTRIB_VALUE': PR_ATTRIB_VALUE,
      -        'PR_COMMENT': PR_COMMENT,
      -        'PR_DECLARATION': PR_DECLARATION,
      -        'PR_KEYWORD': PR_KEYWORD,
      -        'PR_LITERAL': PR_LITERAL,
      -        'PR_NOCODE': PR_NOCODE,
      -        'PR_PLAIN': PR_PLAIN,
      -        'PR_PUNCTUATION': PR_PUNCTUATION,
      -        'PR_SOURCE': PR_SOURCE,
      -        'PR_STRING': PR_STRING,
      -        'PR_TAG': PR_TAG,
      -        'PR_TYPE': PR_TYPE
      -      };
      -})();
      Index: src/main/resources/META-INF/static/images/download.png
      ===================================================================
      Cannot display: file marked as a binary type.
      svn:mime-type = application/octet-stream
      Index: src/main/resources/META-INF/static/style/images/footer.jpg
      ===================================================================
      Cannot display: file marked as a binary type.
      svn:mime-type = application/octet-stream
      Index: src/main/resources/META-INF/static/images/caos_puzzle.jpg
      ===================================================================
      Cannot display: file marked as a binary type.
      svn:mime-type = application/octet-stream
      Index: src/main/resources/META-INF/static/images/previous.png
      ===================================================================
      Cannot display: file marked as a binary type.
      svn:mime-type = application/octet-stream
      Index: src/main/resources/META-INF/static/images/iks_project_logo.jpg
      ===================================================================
      Cannot display: file marked as a binary type.
      svn:mime-type = application/octet-stream
      Index: src/main/resources/META-INF/static/images/loading.gif
      ===================================================================
      Cannot display: file marked as a binary type.
      svn:mime-type = application/octet-stream
      Index: src/main/resources/META-INF/static/scripts/jquery.rdfquery.core-1.0.js
      ===================================================================
      --- src/main/resources/META-INF/static/scripts/jquery.rdfquery.core-1.0.js	(revision 1148250)
      +++ src/main/resources/META-INF/static/scripts/jquery.rdfquery.core-1.0.js	(working copy)
      @@ -1,3598 +0,0 @@
      -/*
      - * $ URIs @VERSION
      - * 
      - * Copyright (c) 2008,2009 Jeni Tennison
      - * Licensed under the MIT (MIT-LICENSE.txt)
      - *
      - */
      -/**
      - * @fileOverview $ URIs
      - * @author <a href="mailto:jeni@jenitennison.com">Jeni Tennison</a>
      - * @copyright (c) 2008,2009 Jeni Tennison
      - * @license MIT license (MIT-LICENSE.txt)
      - * @version 1.0
      - */
      -/**
      - * @class
      - * @name jQuery
      - * @exports $ as jQuery
      - * @description rdfQuery is a <a href="http://jquery.com/">jQuery</a> plugin. The only fields and methods listed here are those that come as part of the rdfQuery library.
      - */
      -(function ($) {
      -
      -  var
      -    mem = {},
      -    uriRegex = /^(([a-z][\-a-z0-9+\.]*):)?(\/\/([^\/?#]+))?([^?#]*)?(\?([^#]*))?(#(.*))?$/i,
      -    docURI,
      -
      -    parseURI = function (u) {
      -      var m = u.match(uriRegex);
      -      if (m === null) {
      -        throw "Malformed URI: " + u;
      -      }
      -      return {
      -        scheme: m[1] ? m[2].toLowerCase() : undefined,
      -        authority: m[3] ? m[4] : undefined,
      -        path: m[5] || '',
      -        query: m[6] ? m[7] : undefined,
      -        fragment: m[8] ? m[9] : undefined
      -      };
      -    },
      -
      -    removeDotSegments = function (u) {
      -      var r = '', m = [];
      -      if (/\./.test(u)) {
      -        while (u !== undefined && u !== '') {
      -          if (u === '.' || u === '..') {
      -            u = '';
      -          } else if (/^\.\.\//.test(u)) { // starts with ../
      -            u = u.substring(3);
      -          } else if (/^\.\//.test(u)) { // starts with ./
      -            u = u.substring(2);
      -          } else if (/^\/\.(\/|$)/.test(u)) { // starts with /./ or consists of /.
      -            u = '/' + u.substring(3);
      -          } else if (/^\/\.\.(\/|$)/.test(u)) { // starts with /../ or consists of /..
      -            u = '/' + u.substring(4);
      -            r = r.replace(/\/?[^\/]+$/, '');
      -          } else {
      -            m = u.match(/^(\/?[^\/]*)(\/.*)?$/);
      -            u = m[2];
      -            r = r + m[1];
      -          }
      -        }
      -        return r;
      -      } else {
      -        return u;
      -      }
      -    },
      -
      -    merge = function (b, r) {
      -      if (b.authority !== '' && (b.path === undefined || b.path === '')) {
      -        return '/' + r;
      -      } else {
      -        return b.path.replace(/[^\/]+$/, '') + r;
      -      }
      -    };
      -
      -  /**
      -   * Creates a new jQuery.uri object. This should be invoked as a method rather than constructed using new.
      -   * @class Represents a URI
      -   * @param {String} [relative='']
      -   * @param {String|jQuery.uri} [base] Defaults to the base URI of the page
      -   * @returns {jQuery.uri} The new jQuery.uri object.
      -   * @example uri = jQuery.uri('/my/file.html');
      -   */
      -  $.uri = function (relative, base) {
      -    var uri;
      -    relative = relative || '';
      -    if (mem[relative]) {
      -      return mem[relative];
      -    }
      -    base = base || $.uri.base();
      -    if (typeof base === 'string') {
      -      base = $.uri.absolute(base);
      -    }
      -    uri = new $.uri.fn.init(relative, base);
      -    if (mem[uri]) {
      -      return mem[uri];
      -    } else {
      -      mem[uri] = uri;
      -      return uri;
      -    }
      -  };
      -
      -  $.uri.fn = $.uri.prototype = {
      -    /**
      -     * The scheme used in the URI
      -     * @type String
      -     */
      -    scheme: undefined,
      -    /**
      -     * The authority used in the URI
      -     * @type String
      -     */
      -    authority: undefined,
      -    /**
      -     * The path used in the URI
      -     * @type String
      -     */
      -    path: undefined,
      -    /**
      -     * The query part of the URI
      -     * @type String
      -     */
      -    query: undefined,
      -    /**
      -     * The fragment part of the URI
      -     * @type String
      -     */
      -    fragment: undefined,
      -    
      -    init: function (relative, base) {
      -      var r = {};
      -      base = base || {};
      -      $.extend(this, parseURI(relative));
      -      if (this.scheme === undefined) {
      -        this.scheme = base.scheme;
      -        if (this.authority !== undefined) {
      -          this.path = removeDotSegments(this.path);
      -        } else {
      -          this.authority = base.authority;
      -          if (this.path === '') {
      -            this.path = base.path;
      -            if (this.query === undefined) {
      -              this.query = base.query;
      -            }
      -          } else {
      -            if (!/^\//.test(this.path)) {
      -              this.path = merge(base, this.path);
      -            }
      -            this.path = removeDotSegments(this.path);
      -          }
      -        }
      -      }
      -      if (this.scheme === undefined) {
      -        throw "Malformed URI: URI is not an absolute URI and no base supplied: " + relative;
      -      }
      -      return this;
      -    },
      -  
      -    /**
      -     * Resolves a relative URI relative to this URI
      -     * @param {String} relative
      -     * @returns jQuery.uri
      -     */
      -    resolve: function (relative) {
      -      return $.uri(relative, this);
      -    },
      -    
      -    /**
      -     * Creates a relative URI giving the path from this URI to the absolute URI passed as a parameter
      -     * @param {String|jQuery.uri} absolute
      -     * @returns String
      -     */
      -    relative: function (absolute) {
      -      var aPath, bPath, i = 0, j, resultPath = [], result = '';
      -      if (typeof absolute === 'string') {
      -        absolute = $.uri(absolute, {});
      -      }
      -      if (absolute.scheme !== this.scheme || 
      -          absolute.authority !== this.authority) {
      -        return absolute.toString();
      -      }
      -      if (absolute.path !== this.path) {
      -        aPath = absolute.path.split('/');
      -        bPath = this.path.split('/');
      -        if (aPath[1] !== bPath[1]) {
      -          result = absolute.path;
      -        } else {
      -          while (aPath[i] === bPath[i]) {
      -            i += 1;
      -          }
      -          j = i;
      -          for (; i < bPath.length - 1; i += 1) {
      -            resultPath.push('..');
      -          }
      -          for (; j < aPath.length; j += 1) {
      -            resultPath.push(aPath[j]);
      -          }
      -          result = resultPath.join('/');
      -        }
      -        result = absolute.query === undefined ? result : result + '?' + absolute.query;
      -        result = absolute.fragment === undefined ? result : result + '#' + absolute.fragment;
      -        return result;
      -      }
      -      if (absolute.query !== undefined && absolute.query !== this.query) {
      -        return '?' + absolute.query + (absolute.fragment === undefined ? '' : '#' + absolute.fragment);
      -      }
      -      if (absolute.fragment !== undefined && absolute.fragment !== this.fragment) {
      -        return '#' + absolute.fragment;
      -      }
      -      return '';
      -    },
      -  
      -    /**
      -     * Returns the URI as an absolute string
      -     * @returns String
      -     */
      -    toString: function () {
      -      var result = '';
      -      if (this._string) {
      -        return this._string;
      -      } else {
      -        result = this.scheme === undefined ? result : (result + this.scheme + ':');
      -        result = this.authority === undefined ? result : (result + '//' + this.authority);
      -        result = result + this.path;
      -        result = this.query === undefined ? result : (result + '?' + this.query);
      -        result = this.fragment === undefined ? result : (result + '#' + this.fragment);
      -        this._string = result;
      -        return result;
      -      }
      -    }
      -  
      -  };
      -
      -  $.uri.fn.init.prototype = $.uri.fn;
      -
      -  /**
      -   * Creates a {@link jQuery.uri} from a known-to-be-absolute URI
      -   * @param {String}
      -   * @returns {jQuery.uri}
      -   */
      -  $.uri.absolute = function (uri) {
      -    return $.uri(uri, {});
      -  };
      -
      -  /**
      -   * Creates a {@link jQuery.uri} from a relative URI and an optional base URI
      -   * @returns {jQuery.uri}
      -   * @see jQuery.uri
      -   */
      -  $.uri.resolve = function (relative, base) {
      -    return $.uri(relative, base);
      -  };
      -  
      -  /**
      -   * Creates a string giving the relative path from a base URI to an absolute URI
      -   * @param {String} absolute
      -   * @param {String} base
      -   * @returns {String}
      -   */
      -  $.uri.relative = function (absolute, base) {
      -    return $.uri(base, {}).relative(absolute);
      -  };
      -  
      -  /**
      -   * Returns the base URI of the page
      -   * @returns {jQuery.uri}
      -   */
      -  $.uri.base = function () {
      -    return $(document).base();
      -  };
      -  
      -  /**
      -   * Returns the base URI in scope for the first selected element
      -   * @methodOf jQuery#
      -   * @name jQuery#base
      -   * @returns {jQuery.uri}
      -   * @example baseURI = $('img').base();
      -   */
      -  $.fn.base = function () {
      -    var base = $(this).parents().andSelf().find('base').attr('href'),
      -      doc = $(this)[0].ownerDocument || document,
      -      docURI = $.uri.absolute(doc.location === null ? document.location.href : doc.location.href);
      -    return base === undefined ? docURI : $.uri(base, docURI);
      -  };
      -
      -})(jQuery);
      -/*
      - * jQuery CURIE @VERSION
      - * 
      - * Copyright (c) 2008,2009 Jeni Tennison
      - * Licensed under the MIT (MIT-LICENSE.txt)
      - *
      - * Depends:
      - *  jquery.uri.js
      - */
      -/**
      - * @fileOverview XML Namespace processing
      - * @author <a href="mailto:jeni@jenitennison.com">Jeni Tennison</a>
      - * @copyright (c) 2008,2009 Jeni Tennison
      - * @license MIT license (MIT-LICENSE.txt)
      - * @version 1.0
      - * @requires jquery.uri.js
      - */
      -
      -/*global jQuery */
      -(function ($) {
      -
      -  var 
      -    xmlnsRegex = /\sxmlns(?::([^ =]+))?\s*=\s*(?:"([^"]*)"|'([^']*)')/g;
      -
      -/**
      - * Returns the namespaces declared in the scope of the first selected element, or
      - * adds a namespace declaration to all selected elements. Pass in no parameters
      - * to return all namespaces bindings on the first selected element. If only 
      - * the prefix parameter is specified, this method will return the namespace
      - * URI that is bound to the specified prefix on the first element in the selection
      - * If the prefix and uri parameters are both specified, this method will
      - * add the binding of the specified prefix and namespace URI to all elements
      - * in the selection.
      - * @methodOf jQuery#
      - * @name jQuery#xmlns
      - * @param {String} [prefix] Restricts the namespaces returned to only the namespace with the specified namespace prefix.
      - * @param {String|jQuery.uri} [uri] Adds a namespace declaration to the selected elements that maps the specified prefix to the specified namespace.
      - * @param {Object} [inherited] A map of inherited namespace bindings.
      - * @returns {Object|jQuery.uri|jQuery}
      - * @example 
      - * // Retrieve all of the namespace bindings on the HTML document element
      - * var nsMap = $('html').xmlns();
      - * @example
      - * // Retrieve the namespace URI mapped to the 'dc' prefix on the HTML document element
      - * var dcNamespace = $('html').xmlns('dc');
      - * @example
      - * // Create a namespace declaration that binds the 'dc' prefix to the URI 'http://purl.org/dc/elements/1.1/'
      - * $('html').xmlns('dc', 'http://purl.org/dc/elements/1.1/');
      - */
      -  $.fn.xmlns = function (prefix, uri, inherited) {
      -    var 
      -      elem = this.eq(0),
      -      ns = elem.data('xmlns'),
      -      e = elem[0], a, p, i,
      -      decl = prefix ? 'xmlns:' + prefix : 'xmlns',
      -      value,
      -      tag, found = false;
      -    if (uri === undefined) {
      -      if (prefix === undefined) { // get the in-scope declarations on the first element
      -        if (ns === undefined) {
      -          ns = {};
      -          if (e.attributes && e.attributes.getNamedItemNS) {
      -            for (i = 0; i < e.attributes.length; i += 1) {
      -              a = e.attributes[i];
      -              if (/^xmlns(:(.+))?$/.test(a.nodeName)) {
      -                prefix = /^xmlns(:(.+))?$/.exec(a.nodeName)[2] || '';
      -                value = a.nodeValue;
      -                if (prefix === '' || value !== '') {
      -                  ns[prefix] = $.uri(a.nodeValue);
      -                  found = true;
      -                }
      -              }
      -            }
      -          } else {
      -            tag = /<[^>]+>/.exec(e.outerHTML);
      -            a = xmlnsRegex.exec(tag);
      -            while (a !== null) {
      -              prefix = a[1] || '';
      -              value = a[2] || a[3];
      -              if (prefix === '' || value !== '') {
      -                ns[prefix] = $.uri(a[2] || a[3]);
      -                found = true;
      -              }
      -              a = xmlnsRegex.exec(tag);
      -            }
      -            xmlnsRegex.lastIndex = 0;
      -          }
      -          inherited = inherited || (e.parentNode.nodeType === 1 ? elem.parent().xmlns() : {});
      -          ns = found ? $.extend({}, inherited, ns) : inherited;
      -          elem.data('xmlns', ns);
      -        }
      -        return ns;
      -      } else if (typeof prefix === 'object') { // set the prefix mappings defined in the object
      -        for (p in prefix) {
      -          if (typeof prefix[p] === 'string') {
      -            this.xmlns(p, prefix[p]);
      -          }
      -        }
      -        this.find('*').andSelf().removeData('xmlns');
      -        return this;
      -      } else { // get the in-scope declaration associated with this prefix on the first element
      -        if (ns === undefined) {
      -          ns = elem.xmlns();
      -        }
      -        return ns[prefix];
      -      }
      -    } else { // set
      -      this.find('*').andSelf().removeData('xmlns');
      -      return this.attr(decl, uri);
      -    }
      -  };
      -
      -/**
      - * Removes one or more XML namespace bindings from the selected elements.
      - * @methodOf jQuery#
      - * @name jQuery#removeXmlns
      - * @param {String|Object|String[]} prefix The prefix(es) of the XML namespace bindings that are to be removed from the selected elements.
      - * @returns {jQuery} The original jQuery object.
      - * @example
      - * // Remove the foaf namespace declaration from the body element:
      - * $('body').removeXmlns('foaf');
      - * @example
      - * // Remove the foo and bar namespace declarations from all h2 elements
      - * $('h2').removeXmlns(['foo', 'bar']);
      - * @example
      - * // Remove the foo and bar namespace declarations from all h2 elements
      - * var namespaces = { foo : 'http://www.example.org/foo', bar : 'http://www.example.org/bar' };
      - * $('h2').removeXmlns(namespaces);
      - */
      -  $.fn.removeXmlns = function (prefix) {
      -    var decl, p, i;
      -    if (typeof prefix === 'object') {
      -      if (prefix.length === undefined) { // assume an object representing namespaces
      -        for (p in prefix) {
      -          if (typeof prefix[p] === 'string') {
      -            this.removeXmlns(p);
      -          }
      -        }
      -      } else { // it's an array
      -        for (i = 0; i < prefix.length; i += 1) {
      -          this.removeXmlns(prefix[i]);
      -        }
      -      }
      -    } else {
      -      decl = prefix ? 'xmlns:' + prefix : 'xmlns';
      -      this.removeAttr(decl);
      -    }
      -    this.find('*').andSelf().removeData('xmlns');
      -    return this;
      -  };
      -
      -  $.fn.qname = function (name) {
      -    var m, prefix, namespace;
      -    if (name === undefined) {
      -      if (this[0].outerHTML === undefined) {
      -        name = this[0].nodeName.toLowerCase();
      -      } else {
      -        name = /<([^ >]+)/.exec(this[0].outerHTML)[1].toLowerCase();
      -      }
      -    }
      -    if (name === '?xml:namespace') {
      -      // there's a prefix on the name, but we can't get at it
      -      throw "XMLinHTML: Unable to get the prefix to resolve the name of this element";
      -    }
      -    m = /^(([^:]+):)?([^:]+)$/.exec(name);
      -    prefix = m[2] || '';
      -    namespace = this.xmlns(prefix);
      -    if (namespace === undefined && prefix !== '') {
      -      throw "MalformedQName: The prefix " + prefix + " is not declared";
      -    }
      -    return {
      -      namespace: namespace,
      -      localPart: m[3],
      -      prefix: prefix,
      -      name: name
      -    };
      -  };
      -
      -})(jQuery);
      -/*
      - * jQuery CURIE @VERSION
      - *
      - * Copyright (c) 2008,2009 Jeni Tennison
      - * Licensed under the MIT (MIT-LICENSE.txt)
      - *
      - * Depends:
      - *  jquery.uri.js
      - */
      -/**
      - * @fileOverview XML Schema datatype handling
      - * @author <a href="mailto:jeni@jenitennison.com">Jeni Tennison</a>
      - * @copyright (c) 2008,2009 Jeni Tennison
      - * @license MIT license (MIT-LICENSE.txt)
      - * @version 1.0
      - * @requires jquery.uri.js
      - */
      -
      -(function ($) {
      -
      -  var strip = function (value) {
      -    return value.replace(/[ \t\n\r]+/, ' ').replace(/^ +/, '').replace(/ +$/, '');
      -  };
      -
      -  /**
      -   * Creates a new jQuery.typedValue object. This should be invoked as a method
      -   * rather than constructed using new.
      -   * @class Represents a value with an XML Schema datatype
      -   * @param {String} value The string representation of the value
      -   * @param {String} datatype The XML Schema datatype URI
      -   * @returns {jQuery.typedValue}
      -   * @example intValue = jQuery.typedValue('42', 'http://www.w3.org/2001/XMLSchema#integer');
      -   */
      -  $.typedValue = function (value, datatype) {
      -    return $.typedValue.fn.init(value, datatype);
      -  };
      -
      -  $.typedValue.fn = $.typedValue.prototype = {
      -    /**
      -     * The string representation of the value
      -     * @memberOf jQuery.typedValue#
      -     */
      -    representation: undefined,
      -    /**
      -     * The value as an object. The type of the object will
      -     * depend on the XML Schema datatype URI specified
      -     * in the constructor. The following table lists the mappings
      -     * currently supported:
      -     * <table>
      -     *   <tr>
      -     *   <th>XML Schema Datatype</th>
      -     *   <th>Value type</th>
      -     *   </tr>
      -     *   <tr>
      -     *     <td>http://www.w3.org/2001/XMLSchema#string</td>
      -     *     <td>string</td>
      -     *   </tr>
      -     *   <tr>
      -     *     <td>http://www.w3.org/2001/XMLSchema#boolean</td>
      -     *     <td>bool</td>
      -     *   </tr>
      -     *   <tr>
      -     *     <td>http://www.w3.org/2001/XMLSchema#decimal</td>
      -     *     <td>string</td>
      -     *   </tr>
      -     *   <tr>
      -     *     <td>http://www.w3.org/2001/XMLSchema#integer</td>
      -     *     <td>int</td>
      -     *   </tr>
      -     *   <tr>
      -     *     <td>http://www.w3.org/2001/XMLSchema#int</td>
      -     *     <td>int</td>
      -     *   </tr>
      -     *   <tr>
      -     *     <td>http://www.w3.org/2001/XMLSchema#float</td>
      -     *     <td>float</td>
      -     *   </tr>
      -     *   <tr>
      -     *     <td>http://www.w3.org/2001/XMLSchema#double</td>
      -     *     <td>float</td>
      -     *   </tr>
      -     *   <tr>
      -     *     <td>http://www.w3.org/2001/XMLSchema#dateTime</td>
      -     *     <td>string</td>
      -     *   </tr>
      -     *   <tr>
      -     *     <td>http://www.w3.org/2001/XMLSchema#date</td>
      -     *     <td>string</td>
      -     *   </tr>
      -     *   <tr>
      -     *     <td>http://www.w3.org/2001/XMLSchema#gMonthDay</td>
      -     *     <td>string</td>
      -     *   </tr>
      -     *   <tr>
      -     *     <td>http://www.w3.org/2001/XMLSchema#anyURI</td>
      -     *     <td>string</td>
      -     *   </tr>
      -     * </table>
      -     * @memberOf jQuery.typedValue#
      -     */
      -    value: undefined,
      -    /**
      -     * The XML Schema datatype URI for the value's datatype
      -     * @memberOf jQuery.typedValue#
      -     */
      -    datatype: undefined,
      -
      -    init: function (value, datatype) {
      -      var d;
      -      if ($.typedValue.valid(value, datatype)) {
      -        d = $.typedValue.types[datatype];
      -        this.representation = value;
      -        this.datatype = datatype;
      -        this.value = d.value(d.strip ? strip(value) : value);
      -        return this;
      -      } else {
      -        throw {
      -          name: 'InvalidValue',
      -          message: value + ' is not a valid ' + datatype + ' value'
      -        };
      -      }
      -    }
      -  };
      -
      -  $.typedValue.fn.init.prototype = $.typedValue.fn;
      -
      -  /**
      -   * An object that holds the datatypes supported by the script. The properties of this object are the URIs of the datatypes, and each datatype has four properties:
      -   * <dl>
      -   *   <dt>strip</dt>
      -   *   <dd>A boolean value that indicates whether whitespace should be stripped from the value prior to testing against the regular expression or passing to the value function.</dd>
      -   *   <dt>regex</dt>
      -   *   <dd>A regular expression that valid values of the type must match.</dd>
      -   *   <dt>validate</dt>
      -   *   <dd>Optional. A function that performs further testing on the value.</dd>
      -   *   <dt>value</dt>
      -   *   <dd>A function that returns a Javascript object equivalent for the value.</dd>
      -   * </dl>
      -   * You can add to this object as necessary for your own datatypes, and {@link jQuery.typedValue} and {@link jQuery.typedValue.valid} will work with them.
      -   * @see jQuery.typedValue
      -   * @see jQuery.typedValue.valid
      -   */
      -  $.typedValue.types = {};
      -
      -  $.typedValue.types['http://www.w3.org/2001/XMLSchema#string'] = {
      -    regex: /^.*$/,
      -    strip: false,
      -    /** @ignore */
      -    value: function (v) {
      -      return v;
      -    }
      -  };
      -
      -  $.typedValue.types['http://www.w3.org/2001/XMLSchema#boolean'] = {
      -    regex: /^(?:true|false|1|0)$/,
      -    strip: true,
      -    /** @ignore */
      -    value: function (v) {
      -      return v === 'true' || v === '1';
      -    }
      -  };
      -
      -  $.typedValue.types['http://www.w3.org/2001/XMLSchema#decimal'] = {
      -    regex: /^[\-\+]?(?:[0-9]+\.[0-9]*|\.[0-9]+|[0-9]+)$/,
      -    strip: true,
      -    /** @ignore */
      -    value: function (v) {
      -      return v;
      -    }
      -  };
      -
      -  $.typedValue.types['http://www.w3.org/2001/XMLSchema#integer'] = {
      -    regex: /^[\-\+]?[0-9]+$/,
      -    strip: true,
      -    /** @ignore */
      -    value: function (v) {
      -      return parseInt(v, 10);
      -    }
      -  };
      -
      -  $.typedValue.types['http://www.w3.org/2001/XMLSchema#int'] = {
      -    regex: /^[\-\+]?[0-9]+$/,
      -    strip: true,
      -    /** @ignore */
      -    value: function (v) {
      -      return parseInt(v, 10);
      -    }
      -  };
      -
      -  $.typedValue.types['http://www.w3.org/2001/XMLSchema#float'] = {
      -    regex: /^(?:[\-\+]?(?:[0-9]+\.[0-9]*|\.[0-9]+|[0-9]+)(?:[eE][\-\+]?[0-9]+)?|[\-\+]?INF|NaN)$/,
      -    strip: true,
      -    /** @ignore */
      -    value: function (v) {
      -      if (v === '-INF') {
      -        return -1 / 0;
      -      } else if (v === 'INF' || v === '+INF') {
      -        return 1 / 0;
      -      } else {
      -        return parseFloat(v);
      -      }
      -    }
      -  };
      -
      -  $.typedValue.types['http://www.w3.org/2001/XMLSchema#double'] = {
      -    regex: $.typedValue.types['http://www.w3.org/2001/XMLSchema#float'].regex,
      -    strip: true,
      -    value: $.typedValue.types['http://www.w3.org/2001/XMLSchema#float'].value
      -  };
      -
      -  $.typedValue.types['http://www.w3.org/2001/XMLSchema#duration'] = {
      -    regex: /^([\-\+])?P(?:([0-9]+)Y)?(?:([0-9]+)M)?(?:([0-9]+)D)?(?:T(?:([0-9]+)H)?(?:([0-9]+)M)?(?:([0-9]+(?:\.[0-9]+))?S)?)$/,
      -    /** @ignore */
      -    validate: function (v) {
      -      var m = this.regex.exec(v);
      -      return m[2] || m[3] || m[4] || m[5] || m[6] || m[7];
      -    },
      -    strip: true,
      -    /** @ignore */
      -    value: function (v) {
      -      return v;
      -    }
      -  };
      -
      -  $.typedValue.types['http://www.w3.org/2001/XMLSchema#dateTime'] = {
      -    regex: /^(-?[0-9]{4,})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2}):(([0-9]{2})(\.([0-9]+))?)((?:[\-\+]([0-9]{2}):([0-9]{2}))|Z)?$/,
      -    /** @ignore */
      -    validate: function (v) {
      -      var
      -        m = this.regex.exec(v),
      -        year = parseInt(m[1], 10),
      -        tz = m[10] === undefined || m[10] === 'Z' ? '+0000' : m[10].replace(/:/, ''),
      -        date;
      -      if (year === 0 ||
      -          parseInt(tz, 10) < -1400 || parseInt(tz, 10) > 1400) {
      -        return false;
      -      }
      -      try {
      -        year = year < 100 ? Math.abs(year) + 1000 : year;
      -        month = parseInt(m[2], 10);
      -        day = parseInt(m[3], 10);
      -        if (day > 31) {
      -          return false;
      -        } else if (day > 30 && !(month === 1 || month === 3 || month === 5 || month === 7 || month === 8 || month === 10 || month === 12)) {
      -          return false;
      -        } else if (month === 2) {
      -          if (day > 29) {
      -            return false;
      -          } else if (day === 29 && (year % 4 !== 0 || (year % 100 === 0 && year % 400 !== 0))) {
      -            return false;
      -          }
      -        }
      -        date = '' + year + '/' + m[2] + '/' + m[3] + ' ' + m[4] + ':' + m[5] + ':' + m[7] + ' ' + tz;
      -        date = new Date(date);
      -        return true;
      -      } catch (e) {
      -        return false;
      -      }
      -    },
      -    strip: true,
      -    /** @ignore */
      -    value: function (v) {
      -      return v;
      -    }
      -  };
      -
      -  $.typedValue.types['http://www.w3.org/2001/XMLSchema#date'] = {
      -    regex: /^(-?[0-9]{4,})-([0-9]{2})-([0-9]{2})((?:[\-\+]([0-9]{2}):([0-9]{2}))|Z)?$/,
      -    /** @ignore */
      -    validate: function (v) {
      -      var
      -        m = this.regex.exec(v),
      -        year = parseInt(m[1], 10),
      -        month = parseInt(m[2], 10),
      -        day = parseInt(m[3], 10),
      -        tz = m[10] === undefined || m[10] === 'Z' ? '+0000' : m[10].replace(/:/, '');
      -      if (year === 0 ||
      -          month > 12 ||
      -          day > 31 ||
      -          parseInt(tz, 10) < -1400 || parseInt(tz, 10) > 1400) {
      -        return false;
      -      } else {
      -        return true;
      -      }
      -    },
      -    strip: true,
      -    /** @ignore */
      -    value: function (v) {
      -      return v;
      -    }
      -  };
      -
      -  $.typedValue.types['http://www.w3.org/2001/XMLSchema#gMonthDay'] = {
      -    regex: /^--([0-9]{2})-([0-9]{2})((?:[\-\+]([0-9]{2}):([0-9]{2}))|Z)?$/,
      -    /** @ignore */
      -    validate: function (v) {
      -      var
      -        m = this.regex.exec(v),
      -        month = parseInt(m[1], 10),
      -        day = parseInt(m[2], 10),
      -        tz = m[3] === undefined || m[3] === 'Z' ? '+0000' : m[3].replace(/:/, '');
      -      if (month > 12 ||
      -          day > 31 ||
      -          parseInt(tz, 10) < -1400 || parseInt(tz, 10) > 1400) {
      -        return false;
      -      } else if (month === 2 && day > 29) {
      -        return false;
      -      } else if ((month === 4 || month === 6 || month === 9 || month === 11) && day > 30) {
      -        return false;
      -      } else {
      -        return true;
      -      }
      -    },
      -    strip: true,
      -    /** @ignore */
      -    value: function (v) {
      -      return v;
      -    }
      -  };
      -
      -  $.typedValue.types['http://www.w3.org/2001/XMLSchema#anyURI'] = {
      -    regex: /^.*$/,
      -    strip: true,
      -    /** @ignore */
      -    value: function (v, options) {
      -      var opts = $.extend({}, $.typedValue.defaults, options);
      -      return $.uri.resolve(v, opts.base);
      -    }
      -  };
      -
      -  $.typedValue.defaults = {
      -    base: $.uri.base(),
      -    namespaces: {}
      -  };
      -
      -  /**
      -   * Checks whether a value is valid according to a given datatype. The datatype must be held in the {@link jQuery.typedValue.types} object.
      -   * @param {String} value The value to validate.
      -   * @param {String} datatype The URI for the datatype against which the value will be validated.
      -   * @returns {boolean} True if the value is valid.
      -   * @throws {String} Errors if the datatype has not been specified in the {@link jQuery.typedValue.types} object.
      -   * @example validDate = $.typedValue.valid(date, 'http://www.w3.org/2001/XMLSchema#date');
      -   */
      -  $.typedValue.valid = function (value, datatype) {
      -    var d = $.typedValue.types[datatype];
      -    if (d === undefined) {
      -      throw "InvalidDatatype: The datatype " + datatype + " can't be recognised";
      -    } else {
      -      value = d.strip ? strip(value) : value;
      -      if (d.regex.test(value)) {
      -        return d.validate === undefined ? true : d.validate(value);
      -      } else {
      -        return false;
      -      }
      -    }
      -  };
      -
      -})(jQuery);
      -/*
      - * jQuery CURIE @VERSION
      - *
      - * Copyright (c) 2008,2009 Jeni Tennison
      - * Licensed under the MIT (MIT-LICENSE.txt)
      - *
      - * Depends:
      - *  jquery.uri.js
      - *  jquery.xmlns.js
      - */
      -
      -/**
      - * @fileOverview jQuery CURIE handling
      - * @author <a href="mailto:jeni@jenitennison.com">Jeni Tennison</a>
      - * @copyright (c) 2008,2009 Jeni Tennison
      - * @license MIT license (MIT-LICENSE.txt)
      - * @version 1.0
      - * @requires jquery.uri.js
      - * @requires jquery.xmlns.js
      - */
      -(function ($) {
      -
      -   /**
      -    * Creates a {@link jQuery.uri} object by parsing a CURIE.
      -    * @methodOf jQuery
      -    * @param {String} curie The CURIE to be parsed
      -    * @param {String} uri The URI string to be converted to a CURIE.
      -    * @param {Object} [options] CURIE parsing options
      -    * @param {string} [options.reservedNamespace='http://www.w3.org/1999/xhtml/vocab#'] The namespace to apply to a CURIE that has no prefix and either starts with a colon or is in the list of reserved local names
      -    * @param {string} [options.defaultNamespace]  The namespace to apply to a CURIE with no prefix which is not mapped to the reserved namespace by the rules given above.
      -    * @param {Object} [options.namespaces] A map of namespace bindings used to map CURIE prefixes to URIs.
      -    * @param {string[]} [options.reserved=['alternate', 'appendix', 'bookmark', 'cite', 'chapter', 'contents', 'copyright', 'first', 'glossary', 'help', 'icon', 'index', 'last', 'license', 'meta', 'next', 'p3pv1', 'prev', 'role', 'section', 'stylesheet', 'subsection', 'start', 'top', 'up']] A list of local names that will always be mapped to the URI specified by reservedNamespace.
      -    * @param {string} [options.charcase='lower'] Specifies whether the curie's case is altered before it's interpreted. Acceptable values are:
      -    * <dl>
      -    * <dt>lower</dt><dd>Force the CURIE string to lower case.</dd>
      -    * <dt>upper</dt><dd>Force the CURIE string to upper case.</dd>
      -    * <dt>preserve</dt><dd>Preserve the original case of the CURIE. Note that this might not be possible if the CURIE has been taken from an HTML attribute value because of the case conversions performed automatically by browsers. For this reason, it's a good idea to avoid mixed-case CURIEs within RDFa.</dd>
      -    * </dl>
      -    * @returns {jQuery.uri} A new {@link jQuery.uri} object representing the full absolute URI specified by the CURIE.
      -    */
      -  $.curie = function (curie, options) {
      -    var
      -      opts = $.extend({}, $.curie.defaults, options || {}),
      -      m = /^(([^:]*):)?(.+)$/.exec(curie),
      -      prefix = m[2],
      -      local = m[3],
      -      ns = opts.namespaces[prefix];
      -    if (/^:.+/.test(curie)) { // This is the case of a CURIE like ":test"
      -      if (opts.reservedNamespace === undefined || opts.reservedNamespace === null) {
      -        throw "Malformed CURIE: No prefix and no default namespace for unprefixed CURIE " + curie;
      -      } else {
      -        ns = opts.reservedNamespace;
      -      }
      -    } else if (prefix) {
      -      if (ns === undefined) {
      -        throw "Malformed CURIE: No namespace binding for " + prefix + " in CURIE " + curie;
      -      }
      -    } else {
      -      if (opts.charcase === 'lower') {
      -        curie = curie.toLowerCase();
      -      } else if (opts.charcase === 'upper') {
      -        curie = curie.toUpperCase();
      -      }
      -      if (opts.reserved.length && $.inArray(curie, opts.reserved) >= 0) {
      -        ns = opts.reservedNamespace;
      -        local = curie;
      -      } else if (opts.defaultNamespace === undefined || opts.defaultNamespace === null) {
      -        // the default namespace is provided by the application; it's not clear whether
      -        // the default XML namespace should be used if there's a colon but no prefix
      -        throw "Malformed CURIE: No prefix and no default namespace for unprefixed CURIE " + curie;
      -      } else {
      -        ns = opts.defaultNamespace;
      -      }
      -    }
      -    return $.uri(ns + local);
      -  };
      -
      -  $.curie.defaults = {
      -    namespaces: {},
      -    reserved: [],
      -    reservedNamespace: undefined,
      -    defaultNamespace: undefined,
      -    charcase: 'preserve'
      -  };
      -
      -   /**
      -    * Creates a {@link jQuery.uri} object by parsing a safe CURIE string (a CURIE
      -    * contained within square brackets). If the input safeCurie string does not
      -    * start with '[' and end with ']', the entire string content will be interpreted
      -    * as a URI string.
      -    * @methodOf jQuery
      -    * @param {String} safeCurie The safe CURIE string to be parsed.
      -    * @param {Object} [options] CURIE parsing options
      -    * @param {string} [options.reservedNamespace='http://www.w3.org/1999/xhtml/vocab#'] The namespace to apply to a CURIE that has no prefix and either starts with a colon or is in the list of reserved local names
      -    * @param {string} [options.defaultNamespace]  The namespace to apply to a CURIE with no prefix which is not mapped to the reserved namespace by the rules given above.
      -    * @param {Object} [options.namespaces] A map of namespace bindings used to map CURIE prefixes to URIs.
      -    * @param {string[]} [options.reserved=['alternate', 'appendix', 'bookmark', 'cite', 'chapter', 'contents', 'copyright',
      -      'first', 'glossary', 'help', 'icon', 'index', 'last', 'license', 'meta', 'next',
      -      'p3pv1', 'prev', 'role', 'section', 'stylesheet', 'subsection', 'start', 'top', 'up']]
      -                        A list of local names that will always be mapped to the URI specified by reservedNamespace.
      -    * @param {string} [options.charcase='lower'] Specifies whether the curie's case is altered before it's interpreted. Acceptable values are:
      -    * <dl>
      -    * <dt>lower</dt><dd>Force the CURIE string to lower case.</dd>
      -    * <dt>upper</dt><dd>Force the CURIE string to upper case.</dd>
      -    * <dt>preserve</dt><dd>Preserve the original case of the CURIE. Note that this might not be possible if the CURIE has been taken from an HTML attribute value because of the case conversions performed automatically by browsers. For this reason, it's a good idea to avoid mixed-case CURIEs within RDFa.</dd>
      -    * </dl>
      -    * @returns {jQuery.uri} A new {@link jQuery.uri} object representing the full absolute URI specified by the CURIE.
      -    */
      -  $.safeCurie = function (safeCurie, options) {
      -    var m = /^\[([^\]]+)\]$/.exec(safeCurie);
      -    return m ? $.curie(m[1], options) : $.uri(safeCurie);
      -  };
      -
      -   /**
      -    * Creates a CURIE string from a URI string.
      -    * @methodOf jQuery
      -    * @param {String} uri The URI string to be converted to a CURIE.
      -    * @param {Object} [options] CURIE parsing options
      -    * @param {string} [options.reservedNamespace='http://www.w3.org/1999/xhtml/vocab#']
      -    *        If the input URI starts with this value, the generated CURIE will
      -    *        have no namespace prefix and will start with a colon character (:),
      -    *        unless the local part of the CURIE is one of the reserved names specified
      -    *        by the reservedNames option (see below), in which case the generated
      -    *        CURIE will have no namespace prefix and will not start with a colon
      -    *        character.
      -    * @param {string} [options.defaultNamespace]  If the input URI starts with this value, the generated CURIE will have no namespace prefix and will not start with a colon.
      -    * @param {Object} [options.namespaces] A map of namespace bindings used to map CURIE prefixes to URIs.
      -    * @param {string[]} [options.reserved=['alternate', 'appendix', 'bookmark', 'cite', 'chapter', 'contents', 'copyright',
      -      'first', 'glossary', 'help', 'icon', 'index', 'last', 'license', 'meta', 'next',
      -      'p3pv1', 'prev', 'role', 'section', 'stylesheet', 'subsection', 'start', 'top', 'up']]
      -                        A list of local names that will always be mapped to the URI specified by reservedNamespace.
      -    * @param {string} [options.charcase='lower'] Specifies the case normalisation done to the CURIE. Acceptable values are:
      -    * <dl>
      -    * <dt>lower</dt><dd>Normalise the CURIE to lower case.</dd>
      -    * <dt>upper</dt><dd>Normalise the CURIE to upper case.</dd>
      -    * <dt>preserve</dt><dd>Preserve the original case of the CURIE. Note that this might not be possible if the CURIE has been taken from an HTML attribute value because of the case conversions performed automatically by browsers. For this reason, it's a good idea to avoid mixed-case CURIEs within RDFa.</dd>
      -    * </dl>
      -    * @returns {jQuery.uri} A new {@link jQuery.uri} object representing the full absolute URI specified by the CURIE.
      -    */
      -  $.createCurie = function (uri, options) {
      -    var opts = $.extend({}, $.curie.defaults, options || {}),
      -      ns = opts.namespaces,
      -      curie;
      -    uri = $.uri(uri).toString();
      -    if (opts.reservedNamespace !== undefined && 
      -        uri.substring(0, opts.reservedNamespace.toString().length) === opts.reservedNamespace.toString()) {
      -      curie = uri.substring(opts.reservedNamespace.toString().length);
      -      if ($.inArray(curie, opts.reserved) === -1) {
      -        curie = ':' + curie;
      -      }
      -    } else {
      -      $.each(ns, function (prefix, namespace) {
      -        if (uri.substring(0, namespace.toString().length) === namespace.toString()) {
      -          curie = prefix + ':' + uri.substring(namespace.toString().length);
      -          return null;
      -        }
      -      });
      -    }
      -    if (curie === undefined) {
      -      throw "No Namespace Binding: There's no appropriate namespace binding for generating a CURIE from " + uri;
      -    } else {
      -      return curie;
      -    }
      -  };
      -
      -   /**
      -    * Creates a {@link jQuery.uri} object by parsing the specified
      -    * CURIE string in the context of the namespaces defined by the
      -    * jQuery selection.
      -    * @methodOf jQuery#
      -    * @name jQuery#curie
      -    * @param {String} curie The CURIE string to be parsed
      -    * @param {Object} options The CURIE parsing options.
      -    *        See {@link jQuery.curie} for details of the supported options.
      -    *        The namespace declarations declared on the current jQuery
      -    *        selection (and inherited from any ancestor elements) will automatically
      -    *        be included in the options.namespaces property.
      -    * @returns {jQuery.uri}
      -    * @see jQuery.curie
      -    */
      -  $.fn.curie = function (curie, options) {
      -    var opts = $.extend({}, $.fn.curie.defaults, { namespaces: this.xmlns() }, options || {});
      -    return $.curie(curie, opts);
      -  };
      -
      -   /**
      -    * Creates a {@link jQuery.uri} object by parsing the specified
      -    * safe CURIE string in the context of the namespaces defined by
      -    * the jQuery selection.
      -    *
      -    * @methodOf jQuery#
      -    * @name jQuery#safeCurie
      -    * @param {String} safeCurie The safe CURIE string to be parsed. See {@link jQuery.safeCurie} for details on how safe CURIE strings are processed.
      -    * @param {Object} options   The CURIE parsing options.
      -    *        See {@link jQuery.safeCurie} for details of the supported options.
      -    *        The namespace declarations declared on the current jQuery
      -    *        selection (and inherited from any ancestor elements) will automatically
      -    *        be included in the options.namespaces property.
      -    * @returns {jQuery.uri}
      -    * @see jQuery.safeCurie
      -    */
      -  $.fn.safeCurie = function (safeCurie, options) {
      -    var opts = $.extend({}, $.fn.curie.defaults, { namespaces: this.xmlns() }, options || {});
      -    return $.safeCurie(safeCurie, opts);
      -  };
      -
      -   /**
      -    * Creates a CURIE string from a URI string using the namespace
      -    * bindings in the context of the current jQuery selection.
      -    *
      -    * @methodOf jQuery#
      -    * @name jQuery#createCurie
      -    * @param {String|jQuery.uri} uri The URI string to be converted to a CURIE
      -    * @param {Object} options the CURIE parsing options.
      -    *        See {@link jQuery.createCurie} for details of the supported options.
      -    *        The namespace declarations declared on the current jQuery
      -    *        selection (and inherited from any ancestor elements) will automatically
      -    *        be included in the options.namespaces property.
      -    * @returns {String}
      -    * @see jQuery.createCurie
      -    */
      -  $.fn.createCurie = function (uri, options) {
      -    var opts = $.extend({}, $.fn.curie.defaults, { namespaces: this.xmlns() }, options || {});
      -    return $.createCurie(uri, opts);
      -  };
      -
      -  $.fn.curie.defaults = {
      -    reserved: [
      -      'alternate', 'appendix', 'bookmark', 'cite', 'chapter', 'contents', 'copyright',
      -      'first', 'glossary', 'help', 'icon', 'index', 'last', 'license', 'meta', 'next',
      -      'p3pv1', 'prev', 'role', 'section', 'stylesheet', 'subsection', 'start', 'top', 'up'
      -    ],
      -    reservedNamespace: 'http://www.w3.org/1999/xhtml/vocab#',
      -    defaultNamespace: undefined,
      -    charcase: 'lower'
      -  };
      -
      -})(jQuery);
      -/*
      - * jQuery RDF @VERSION
      - *
      - * Copyright (c) 2008,2009 Jeni Tennison
      - * Licensed under the MIT (MIT-LICENSE.txt)
      - *
      - * Depends:
      - *  jquery.uri.js
      - *  jquery.xmlns.js
      - *  jquery.datatype.js
      - *  jquery.curie.js
      - *  jquery.json.js
      - */
      -/**
      - * @fileOverview jQuery RDF
      - * @author <a href="mailto:jeni@jenitennison.com">Jeni Tennison</a>
      - * @copyright (c) 2008,2009 Jeni Tennison
      - * @license MIT license (MIT-LICENSE.txt)
      - * @version 1.0
      - */
      -/**
      - * @exports $ as jQuery
      - */
      -/**
      - * @ignore
      - */
      -(function ($) {
      -
      -  var
      -    memResource = {},
      -    memBlank = {},
      -    memLiteral = {},
      -    memTriple = {},
      -    memPattern = {},
      -    xsdNs = "http://www.w3.org/2001/XMLSchema#",
      -    rdfNs = "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
      -    rdfsNs = "http://www.w3.org/2000/01/rdf-schema#",
      -    uriRegex = /^<(([^>]|\\>)*)>$/,
      -    literalRegex = /^("""((\\"|[^"])*)"""|"((\\"|[^"])*)")(@([a-z]+(-[a-z0-9]+)*)|\^\^(.+))?$/,
      -    tripleRegex = /(("""((\\"|[^"])*)""")|("(\\"|[^"]|)*")|(<(\\>|[^>])*>)|\S)+/g,
      -
      -    blankNodeSeed = databankSeed = new Date().getTime() % 1000,
      -    blankNodeID = function () {
      -      blankNodeSeed += 1;
      -      return 'b' + blankNodeSeed.toString(16);
      -    },
      -
      -    databankID = function () {
      -      databankSeed += 1;
      -      return 'data' + databankSeed.toString(16);
      -    },
      -
      -    subject = function (subject, opts) {
      -      if (typeof subject === 'string') {
      -        try {
      -          return $.rdf.resource(subject, opts);
      -        } catch (e) {
      -          try {
      -            return $.rdf.blank(subject, opts);
      -          } catch (f) {
      -            throw "Bad Triple: Subject " + subject + " is not a resource: " + f;
      -          }
      -        }
      -      } else {
      -        return subject;
      -      }
      -    },
      -
      -    property = function (property, opts) {
      -      if (property === 'a') {
      -        return $.rdf.type;
      -      } else if (typeof property === 'string') {
      -        try {
      -          return $.rdf.resource(property, opts);
      -        } catch (e) {
      -          throw "Bad Triple: Property " + property + " is not a resource: " + e;
      -        }
      -      } else {
      -        return property;
      -      }
      -    },
      -
      -    object = function (object, opts) {
      -      if (typeof object === 'string') {
      -        try {
      -          return $.rdf.resource(object, opts);
      -        } catch (e) {
      -          try {
      -            return $.rdf.blank(object, opts);
      -          } catch (f) {
      -            try {
      -              return $.rdf.literal(object, opts);
      -            } catch (g) {
      -              throw "Bad Triple: Object " + object + " is not a resource or a literal " + g;
      -            }
      -          }
      -        }
      -      } else {
      -        return object;
      -      }
      -    },
      -
      -    testResource = function (resource, filter, existing) {
      -      var variable;
      -      if (typeof filter === 'string') {
      -        variable = filter.substring(1);
      -        if (existing[variable] && existing[variable] !== resource) {
      -          return null;
      -        } else {
      -          existing[variable] = resource;
      -          return existing;
      -        }
      -      } else if (filter === resource) {
      -        return existing;
      -      } else {
      -        return null;
      -      }
      -    },
      -
      -    findMatches = function (triples, pattern) {
      -      return $.map(triples, function (triple) {
      -        var bindings = pattern.exec(triple);
      -        return bindings === null ? null : { bindings: bindings, triples: [triple] };
      -      });
      -    },
      -
      -    mergeMatches = function (existingMs, newMs, optional) {
      -      return $.map(existingMs, function (existingM, i) {
      -        var compatibleMs = $.map(newMs, function (newM) {
      -          // For newM to be compatible with existingM, all the bindings
      -          // in newM must either be the same as in existingM, or not
      -          // exist in existingM
      -          var isCompatible = true;
      -          $.each(newM.bindings, function (k, b) {
      -            if (!(existingM.bindings[k] === undefined ||
      -                  existingM.bindings[k] === b)) {
      -              isCompatible = false;
      -              return false;
      -            }
      -          });
      -          return isCompatible ? newM : null;
      -        });
      -        if (compatibleMs.length > 0) {
      -          return $.map(compatibleMs, function (compatibleM) {
      -            return {
      -              bindings: $.extend({}, existingM.bindings, compatibleM.bindings),
      -              triples: $.unique(existingM.triples.concat(compatibleM.triples))
      -            };
      -          });
      -        } else {
      -          return optional ? existingM : null;
      -        }
      -      });
      -    },
      -
      -    registerQuery = function (databank, query) {
      -      var s, p, o;
      -      if (query.filterExp !== undefined && !$.isFunction(query.filterExp)) {
      -        if (databank.union === undefined) {
      -          s = typeof query.filterExp.subject === 'string' ? '' : query.filterExp.subject;
      -          p = typeof query.filterExp.property === 'string' ? '' : query.filterExp.property;
      -          o = typeof query.filterExp.object === 'string' ? '' : query.filterExp.object;
      -          if (databank.queries[s] === undefined) {
      -            databank.queries[s] = {};
      -          }
      -          if (databank.queries[s][p] === undefined) {
      -            databank.queries[s][p] = {};
      -          }
      -          if (databank.queries[s][p][o] === undefined) {
      -            databank.queries[s][p][o] = [];
      -          }
      -          databank.queries[s][p][o].push(query);
      -        } else {
      -          $.each(databank.union, function (i, databank) {
      -            registerQuery(databank, query);
      -          });
      -        }
      -      }
      -    },
      -
      -    resetQuery = function (query) {
      -      query.length = 0;
      -      query.matches = [];
      -      $.each(query.children, function (i, child) {
      -        resetQuery(child);
      -      });
      -      $.each(query.partOf, function (i, union) {
      -        resetQuery(union);
      -      });
      -    },
      -
      -    updateQuery = function (query, matches) {
      -      if (matches.length > 0) {
      -        $.each(query.children, function (i, child) {
      -          leftActivate(child, matches);
      -        });
      -        $.each(query.partOf, function (i, union) {
      -          updateQuery(union, matches);
      -        });
      -        $.each(matches, function (i, match) {
      -          query.matches.push(match);
      -          Array.prototype.push.call(query, match.bindings);
      -        });
      -      }
      -    },
      -
      -    leftActivate = function (query, matches) {
      -      var newMatches;
      -      if (query.union === undefined) {
      -        if (query.top || query.parent.top) {
      -          newMatches = query.alphaMemory;
      -        } else {
      -          matches = matches || query.parent.matches;
      -          if ($.isFunction(query.filterExp)) {
      -            newMatches = $.map(matches, function (match, i) {
      -              return query.filterExp.call(match.bindings, i, match.bindings, match.triples) ? match : null;
      -            });
      -          } else {
      -            newMatches = mergeMatches(matches, query.alphaMemory, query.filterExp.optional);
      -          }
      -        }
      -      } else {
      -        newMatches = $.map(query.union, function (q) {
      -          return q.matches;
      -        });
      -      }
      -      updateQuery(query, newMatches);
      -    },
      -
      -    rightActivate = function (query, match) {
      -      var newMatches;
      -      if (query.filterExp.optional) {
      -        resetQuery(query);
      -        leftActivate(query);
      -      } else {
      -        if (query.top || query.parent.top) {
      -          newMatches = [match];
      -        } else {
      -          newMatches = mergeMatches(query.parent.matches, [match], false);
      -        }
      -        updateQuery(query, newMatches);
      -      }
      -    },
      -
      -    addToQuery = function (query, triple) {
      -      var match,
      -        bindings = query.filterExp.exec(triple);
      -      if (bindings !== null) {
      -        match = { triples: [triple], bindings: bindings };
      -        query.alphaMemory.push(match);
      -        rightActivate(query, match);
      -      }
      -    },
      -
      -    removeFromQuery = function (query, triple) {
      -      query.alphaMemory.splice($.inArray(triple, query.alphaMemory), 1);
      -      resetQuery(query);
      -      leftActivate(query);
      -    },
      -
      -    addToQueries = function (queries, triple) {
      -      $.each(queries, function (i, query) {
      -        addToQuery(query, triple);
      -      });
      -    },
      -
      -    removeFromQueries = function (queries, triple) {
      -      $.each(queries, function (i, query) {
      -        removeFromQuery(query, triple);
      -      });
      -    },
      -
      -    addToDatabankQueries = function (databank, triple) {
      -      var s = triple.subject,
      -        p = triple.property,
      -        o = triple.object;
      -      if (databank.union === undefined) {
      -        if (databank.queries[s] !== undefined) {
      -          if (databank.queries[s][p] !== undefined) {
      -            if (databank.queries[s][p][o] !== undefined) {
      -              addToQueries(databank.queries[s][p][o], triple);
      -            }
      -            if (databank.queries[s][p][''] !== undefined) {
      -              addToQueries(databank.queries[s][p][''], triple);
      -            }
      -          }
      -          if (databank.queries[s][''] !== undefined) {
      -            if (databank.queries[s][''][o] !== undefined) {
      -              addToQueries(databank.queries[s][''][o], triple);
      -            }
      -            if (databank.queries[s][''][''] !== undefined) {
      -              addToQueries(databank.queries[s][''][''], triple);
      -            }
      -          }
      -        }
      -        if (databank.queries[''] !== undefined) {
      -          if (databank.queries[''][p] !== undefined) {
      -            if (databank.queries[''][p][o] !== undefined) {
      -              addToQueries(databank.queries[''][p][o], triple);
      -            }
      -            if (databank.queries[''][p][''] !== undefined) {
      -              addToQueries(databank.queries[''][p][''], triple);
      -            }
      -          }
      -          if (databank.queries[''][''] !== undefined) {
      -            if (databank.queries[''][''][o] !== undefined) {
      -              addToQueries(databank.queries[''][''][o], triple);
      -            }
      -            if (databank.queries[''][''][''] !== undefined) {
      -              addToQueries(databank.queries[''][''][''], triple);
      -            }
      -          }
      -        }
      -      } else {
      -        $.each(databank.union, function (i, databank) {
      -          addToDatabankQueries(databank, triple);
      -        });
      -      }
      -    },
      -
      -    removeFromDatabankQueries = function (databank, triple) {
      -      var s = triple.subject,
      -        p = triple.property,
      -        o = triple.object;
      -      if (databank.union === undefined) {
      -        if (databank.queries[s] !== undefined) {
      -          if (databank.queries[s][p] !== undefined) {
      -            if (databank.queries[s][p][o] !== undefined) {
      -              removeFromQueries(databank.queries[s][p][o], triple);
      -            }
      -            if (databank.queries[s][p][''] !== undefined) {
      -              removeFromQueries(databank.queries[s][p][''], triple);
      -            }
      -          }
      -          if (databank.queries[s][''] !== undefined) {
      -            if (databank.queries[s][''][o] !== undefined) {
      -              removeFromQueries(databank.queries[s][''][o], triple);
      -            }
      -            if (databank.queries[s][''][''] !== undefined) {
      -              removeFromQueries(databank.queries[s][''][''], triple);
      -            }
      -          }
      -        }
      -        if (databank.queries[''] !== undefined) {
      -          if (databank.queries[''][p] !== undefined) {
      -            if (databank.queries[''][p][o] !== undefined) {
      -              removeFromQueries(databank.queries[''][p][o], triple);
      -            }
      -            if (databank.queries[''][p][''] !== undefined) {
      -              removeFromQueries(databank.queries[''][p][''], triple);
      -            }
      -          }
      -          if (databank.queries[''][''] !== undefined) {
      -            if (databank.queries[''][''][o] !== undefined) {
      -              removeFromQueries(databank.queries[''][''][o], triple);
      -            }
      -            if (databank.queries[''][''][''] !== undefined) {
      -              removeFromQueries(databank.queries[''][''][''], triple);
      -            }
      -          }
      -        }
      -      } else {
      -        $.each(databank.union, function (i, databank) {
      -          removeFromDatabankQueries(databank, triple);
      -        });
      -      }
      -    },
      -
      -    createJson = function (triples) {
      -      var e = {},
      -        i, t, s, p;
      -      for (i = 0; i < triples.length; i += 1) {
      -        t = triples[i];
      -        s = t.subject.value.toString();
      -        p = t.property.value.toString();
      -        if (e[s] === undefined) {
      -          e[s] = {};
      -        }
      -        if (e[s][p] === undefined) {
      -          e[s][p] = [];
      -        }
      -        e[s][p].push(t.object.dump());
      -      }
      -      return e;
      -    },
      -
      -    parseJson = function (data) {
      -      var s, subject, p, property, o, object, i, opts, triples = [];
      -      for (s in data) {
      -        subject = (s.substring(0, 2) === '_:') ? $.rdf.blank(s) : $.rdf.resource('<' + s + '>');
      -        for (p in data[s]) {
      -          property = $.rdf.resource('<' + p + '>');
      -          for (i = 0; i < data[s][p].length; i += 1) {
      -            o = data[s][p][i];
      -            if (o.type === 'uri') {
      -              object = $.rdf.resource('<' + o.value + '>');
      -            } else if (o.type === 'bnode') {
      -              object = $.rdf.blank(o.value);
      -            } else {
      -              // o.type === 'literal'
      -              if (o.datatype !== undefined) {
      -                object = $.rdf.literal(o.value, { datatype: o.datatype });
      -              } else {
      -                opts = {};
      -                if (o.lang !== undefined) {
      -                  opts.lang = o.lang;
      -                }
      -                object = $.rdf.literal('"' + o.value + '"', opts);
      -              }
      -            }
      -            triples.push($.rdf.triple(subject, property, object));
      -          }
      -        }
      -      }
      -      return triples;
      -    },
      -
      -    addAttribute = function (parent, namespace, name, value) {
      -      var doc = parent.ownerDocument,
      -        a;
      -      if (namespace !== undefined && namespace !== null) {
      -        if (doc.createAttributeNS) {
      -          a = doc.createAttributeNS(namespace, name);
      -          a.nodeValue = value;
      -          parent.attributes.setNamedItemNS(a);
      -        } else {
      -          a = doc.createNode(2, name, namespace);
      -          a.nodeValue = value;
      -          parent.attributes.setNamedItem(a);
      -        }
      -      } else {
      -        a = doc.createAttribute(name);
      -        a.nodeValue = value;
      -        parent.attributes.setNamedItem(a);
      -      }
      -      return parent;
      -    },
      -
      -    createXmlnsAtt = function (parent, namespace, prefix) {
      -      if (prefix) {
      -        addAttribute(parent, 'http://www.w3.org/2000/xmlns/', 'xmlns:' + prefix, namespace);
      -      } else {
      -        addAttribute(parent, undefined, 'xmlns', namespace);
      -      }
      -      return parent;
      -    },
      -
      -    createDocument = function (namespace, name) {
      -      var doc, xmlns = '', prefix, addAttribute = false;
      -      if (namespace !== undefined && namespace !== null) {
      -        if (/:/.test(name)) {
      -          prefix = /([^:]+):/.exec(name)[1];
      -        }
      -        addAttribute = true;
      -      }
      -      if (document.implementation &&
      -          document.implementation.createDocument) {
      -        doc = document.implementation.createDocument(namespace, name, null);
      -        if (addAttribute) {
      -          createXmlnsAtt(doc.documentElement, namespace, prefix);
      -        }
      -        return doc;
      -      } else {
      -        doc = new ActiveXObject("Microsoft.XMLDOM");
      -        doc.async = "false";
      -        if (prefix === undefined) {
      -          xmlns = ' xmlns="' + namespace + '"';
      -        } else {
      -          xmlns = ' xmlns:' + prefix + '="' + namespace + '"';
      -        }
      -        doc.loadXML('<' + name + xmlns + '/>');
      -        return doc;
      -      }
      -    },
      -
      -    appendElement = function (parent, namespace, name) {
      -      var doc = parent.ownerDocument,
      -        e;
      -      if (namespace !== undefined && namespace !== null) {
      -        e = doc.createElementNS ? doc.createElementNS(namespace, name) : doc.createNode(1, name, namespace);
      -      } else {
      -        e = doc.createElement(name);
      -      }
      -      parent.appendChild(e);
      -      return e;
      -    },
      -
      -    appendText = function (parent, text) {
      -      var doc = parent.ownerDocument,
      -        t;
      -      t = doc.createTextNode(text);
      -      parent.appendChild(t);
      -      return parent;
      -    },
      -
      -    appendXML = function (parent, xml) {
      -      var parser, doc, i, child;
      -      try {
      -        doc = new ActiveXObject('Microsoft.XMLDOM');
      -        doc.async = "false";
      -        doc.loadXML('<temp>' + xml + '</temp>');
      -      } catch(e) {
      -        parser = new DOMParser();
      -        doc = parser.parseFromString('<temp>' + xml + '</temp>', 'text/xml');
      -      }
      -      for (i = 0; i < doc.documentElement.childNodes.length; i += 1) {
      -        parent.appendChild(doc.documentElement.childNodes[i].cloneNode(true));
      -      }
      -      return parent;
      -    },
      -
      -    createRdfXml = function (triples, options) {
      -      var doc = createDocument(rdfNs, 'rdf:RDF'),
      -        dump = createJson(triples),
      -        namespaces = options.namespaces || {},
      -        n, s, se, p, pe, i, v,
      -        m, local, ns, prefix;
      -      for (n in namespaces) {
      -        createXmlnsAtt(doc.documentElement, namespaces[n], n);
      -      }
      -      for (s in dump) {
      -        if (dump[s][$.rdf.type.value] !== undefined) {
      -          m = /(.+[#\/])([^#\/]+)/.exec(dump[s][$.rdf.type.value][0].value);
      -          ns = m[1];
      -          local = m[2];
      -          for (n in namespaces) {
      -            if (namespaces[n] === ns) {
      -              prefix = n;
      -              break;
      -            }
      -          }
      -          se = appendElement(doc.documentElement, ns, prefix + ':' + local);
      -        } else {
      -          se = appendElement(doc.documentElement, rdfNs, 'rdf:Description');
      -        }
      -        if (/^_:/.test(s)) {
      -          addAttribute(se, rdfNs, 'rdf:nodeID', s.substring(2));
      -        } else {
      -          addAttribute(se, rdfNs, 'rdf:about', s);
      -        }
      -        for (p in dump[s]) {
      -          if (p !== $.rdf.type.value.toString() || dump[s][p].length > 1) {
      -            m = /(.+[#\/])([^#\/]+)/.exec(p);
      -            ns = m[1];
      -            local = m[2];
      -            for (n in namespaces) {
      -              if (namespaces[n] === ns) {
      -                prefix = n;
      -                break;
      -              }
      -            }
      -            for (i = (p === $.rdf.type.value.toString() ? 1 : 0); i < dump[s][p].length; i += 1) {
      -              v = dump[s][p][i];
      -              pe = appendElement(se, ns, prefix + ':' + local);
      -              if (v.type === 'uri') {
      -                addAttribute(pe, rdfNs, 'rdf:resource', v.value);
      -              } else if (v.type === 'literal') {
      -                if (v.datatype !== undefined) {
      -                  if (v.datatype === 'http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral') {
      -                    addAttribute(pe, rdfNs, 'rdf:parseType', 'Literal');
      -                    appendXML(pe, v.value);
      -                  } else {
      -                    addAttribute(pe, rdfNs, 'rdf:datatype', v.datatype);
      -                    appendText(pe, v.value);
      -                  }
      -                } else if (v.lang !== undefined) {
      -                  addAttribute(pe, 'http://www.w3.org/XML/1998/namespace', 'xml:lang', v.lang);
      -                  appendText(pe, v.value);
      -                } else {
      -                  appendText(pe, v.value);
      -                }
      -              } else {
      -                // blank node
      -                addAttribute(pe, rdfNs, 'rdf:nodeID', v.value.substring(2));
      -              }
      -            }
      -          }
      -        }
      -      }
      -      return doc;
      -    },
      -
      -    getDefaultNamespacePrefix = function(namespaceUri){
      -      switch (namespaceUri) {
      -        case 'http://www.w3.org/1999/02/22-rdf-syntax-ns':
      -          return 'rdf';
      -        case 'http://www.w3.org/XML/1998/namespace':
      -          return 'xml';
      -        case 'http://www.w3.org/2000/xmlns/':
      -          return 'xmlns';
      -        default:
      -          throw ('No default prefix mapped for namespace ' + namespaceUri);
      -      }
      -    },
      -
      -    hasAttributeNS  = function(elem, namespace, name){
      -      var basename;
      -      if (elem.hasAttributeNS) {
      -        return elem.hasAttributeNS(namespace, name);
      -      } else {
      -        try {
      -          basename = /:/.test(name) ? /:(.+)$/.exec(name)[1] : name;
      -          return elem.attributes.getQualifiedItem(basename, namespace) !== null;
      -        } catch (e) {
      -          return elem.getAttribute(getDefaultNamespacePrefix(namespace) + ':' + name) !== null;
      -        }
      -      }
      -    },
      -
      -    getAttributeNS = function(elem, namespace, name){
      -      var basename;
      -      if (elem.getAttributeNS) {
      -        return elem.getAttributeNS(namespace, name);
      -      } else {
      -        try {
      -          basename = /:/.test(name) ? /:(.+)$/.exec(name)[1] : name;
      -          return elem.attributes.getQualifiedItem(basename, namespace).nodeValue;
      -        } catch (e) {
      -          return elem.getAttribute(getDefaultNamespacePrefix(namespace) + ':' + name);
      -        }
      -      }
      -    },
      -
      -    getLocalName = function(elem){
      -      return elem.localName || elem.baseName;
      -    },
      -
      -    parseRdfXmlSubject = function (elem, base) {
      -      var s, subject;
      -      if (hasAttributeNS(elem, rdfNs, 'about')) {
      -        s = getAttributeNS(elem, rdfNs, 'about');
      -        subject = $.rdf.resource('<' + s + '>', { base: base });
      -      } else if (hasAttributeNS(elem, rdfNs, 'ID')) {
      -        s = getAttributeNS(elem, rdfNs, 'ID');
      -        subject = $.rdf.resource('<#' + s + '>', { base: base });
      -      } else if (hasAttributeNS(elem, rdfNs, 'nodeID')) {
      -        s = getAttributeNS(elem, rdfNs, 'nodeID');
      -        subject = $.rdf.blank('_:' + s);
      -      } else {
      -        subject = $.rdf.blank('[]');
      -      }
      -      return subject;
      -    },
      -
      -    parseRdfXmlDescription = function (elem, isDescription, base, lang) {
      -      var subject, p, property, o, object, reified, lang, i, j, li = 1,
      -        collection1, collection2, collectionItem, collectionItems = [],
      -        parseType, serializer, literalOpts = {}, oTriples, triples = [];
      -      lang = getAttributeNS(elem, 'http://www.w3.org/XML/1998/namespace', 'lang') || lang;
      -      base = getAttributeNS(elem, 'http://www.w3.org/XML/1998/namespace', 'base') || base;
      -      if (lang !== null && lang !== undefined && lang !== '') {
      -        literalOpts = { lang: lang };
      -      }
      -      subject = parseRdfXmlSubject(elem, base);
      -      if (isDescription && (elem.namespaceURI !== rdfNs || getLocalName(elem) !== 'Description')) {
      -        property = $.rdf.type;
      -        object = $.rdf.resource('<' + elem.namespaceURI + getLocalName(elem) + '>');
      -        triples.push($.rdf.triple(subject, property, object));
      -      }
      -      for (i = 0; i < elem.attributes.length; i += 1) {
      -        p = elem.attributes.item(i);
      -        if (p.namespaceURI !== undefined &&
      -            p.namespaceURI !== 'http://www.w3.org/2000/xmlns/' &&
      -            p.namespaceURI !== 'http://www.w3.org/XML/1998/namespace' &&
      -            p.prefix !== 'xmlns' &&
      -            p.prefix !== 'xml') {
      -          if (p.namespaceURI !== rdfNs) {
      -            property = $.rdf.resource('<' + p.namespaceURI + getLocalName(p) + '>');
      -            object = $.rdf.literal('"' + p.nodeValue + '"', literalOpts);
      -            triples.push($.rdf.triple(subject, property, object));
      -          } else if (getLocalName(p) === 'type') {
      -            property = $.rdf.type;
      -            object = $.rdf.resource('<' + p.nodeValue + '>', { base: base });
      -            triples.push($.rdf.triple(subject, property, object));
      -          }
      -        }
      -      }
      -      for (i = 0; i < elem.childNodes.length; i += 1) {
      -        p = elem.childNodes[i];
      -        if (p.nodeType === 1) {
      -          if (p.namespaceURI === rdfNs && getLocalName(p) === 'li') {
      -            property = $.rdf.resource('<' + rdfNs + '_' + li + '>');
      -            li += 1;
      -          } else {
      -            property = $.rdf.resource('<' + p.namespaceURI + getLocalName(p) + '>');
      -          }
      -          lang = getAttributeNS(p, 'http://www.w3.org/XML/1998/namespace', 'lang') || lang;
      -          if (lang !== null && lang !== undefined && lang !== '') {
      -            literalOpts = { lang: lang };
      -          }
      -          if (hasAttributeNS(p, rdfNs, 'resource')) {
      -            o = getAttributeNS(p, rdfNs, 'resource');
      -            object = $.rdf.resource('<' + o + '>', { base: base });
      -          } else if (hasAttributeNS(p, rdfNs, 'nodeID')) {
      -            o = getAttributeNS(p, rdfNs, 'nodeID');
      -            object = $.rdf.blank('_:' + o);
      -          } else if (hasAttributeNS(p, rdfNs, 'parseType')) {
      -            parseType = getAttributeNS(p, rdfNs, 'parseType');
      -            if (parseType === 'Literal') {
      -              try {
      -                serializer = new XMLSerializer();
      -                o = serializer.serializeToString(p.getElementsByTagName('*')[0]);
      -              } catch (e) {
      -                o = "";
      -                for (j = 0; j < p.childNodes.length; j += 1) {
      -                  o += p.childNodes[j].xml;
      -                }
      -              }
      -              object = $.rdf.literal(o, { datatype: rdfNs + 'XMLLiteral' });
      -            } else if (parseType === 'Resource') {
      -              oTriples = parseRdfXmlDescription(p, false, base, lang);
      -              if (oTriples.length > 0) {
      -                object = oTriples[oTriples.length - 1].subject;
      -                triples = triples.concat(oTriples);
      -              } else {
      -                object = $.rdf.blank('[]');
      -              }
      -            } else if (parseType === 'Collection') {
      -              if (p.getElementsByTagName('*').length > 0) {
      -                for (j = 0; j < p.childNodes.length; j += 1) {
      -                  o = p.childNodes[j];
      -                  if (o.nodeType === 1) {
      -                    collectionItems.push(o);
      -                  }
      -                }
      -                collection1 = $.rdf.blank('[]');
      -                object = collection1;
      -                for (j = 0; j < collectionItems.length; j += 1) {
      -                  o = collectionItems[j];
      -                  oTriples = parseRdfXmlDescription(o, true, base, lang);
      -                  if (oTriples.length > 0) {
      -                    collectionItem = oTriples[oTriples.length - 1].subject;
      -                    triples = triples.concat(oTriples);
      -                  } else {
      -                    collectionItem = parseRdfXmlSubject(o);
      -                  }
      -                  triples.push($.rdf.triple(collection1, $.rdf.first, collectionItem));
      -                  if (j === collectionItems.length - 1) {
      -                    triples.push($.rdf.triple(collection1, $.rdf.rest, $.rdf.nil));
      -                  } else {
      -                    collection2 = $.rdf.blank('[]');
      -                    triples.push($.rdf.triple(collection1, $.rdf.rest, collection2));
      -                    collection1 = collection2;
      -                  }
      -                }
      -              } else {
      -                object = $.rdf.nil;
      -              }
      -            }
      -          } else if (hasAttributeNS(p, rdfNs, 'datatype')) {
      -            o = p.childNodes[0].nodeValue;
      -            object = $.rdf.literal(o, { datatype: getAttributeNS(p, rdfNs, 'datatype') });
      -          } else if (p.getElementsByTagName('*').length > 0) {
      -            for (j = 0; j < p.childNodes.length; j += 1) {
      -              o = p.childNodes[j];
      -              if (o.nodeType === 1) {
      -                oTriples = parseRdfXmlDescription(o, true, base, lang);
      -                if (oTriples.length > 0) {
      -                  object = oTriples[oTriples.length - 1].subject;
      -                  triples = triples.concat(oTriples);
      -                } else {
      -                  object = parseRdfXmlSubject(o);
      -                }
      -              }
      -            }
      -          } else if (p.childNodes.length > 0) {
      -            o = p.childNodes[0].nodeValue;
      -            object = $.rdf.literal('"' + o + '"', literalOpts);
      -          } else {
      -            oTriples = parseRdfXmlDescription(p, false, base, lang);
      -            if (oTriples.length > 0) {
      -              object = oTriples[oTriples.length - 1].subject;
      -              triples = triples.concat(oTriples);
      -            } else {
      -              object = $.rdf.blank('[]');
      -            }
      -          }
      -          triples.push($.rdf.triple(subject, property, object));
      -          if (hasAttributeNS(p, rdfNs, 'ID')) {
      -            reified = $.rdf.resource('<#' + getAttributeNS(p, rdfNs, 'ID') + '>', { base: base });
      -            triples.push($.rdf.triple(reified, $.rdf.subject, subject));
      -            triples.push($.rdf.triple(reified, $.rdf.property, property));
      -            triples.push($.rdf.triple(reified, $.rdf.object, object));
      -          }
      -        }
      -      }
      -      return triples;
      -    },
      -
      -    parseRdfXml = function (doc) {
      -      var i, lang, d, triples = [];
      -      if (doc.documentElement.namespaceURI === rdfNs && getLocalName(doc.documentElement) === 'RDF') {
      -        lang = getAttributeNS(doc.documentElement, 'http://www.w3.org/XML/1998/namespace', 'lang');
      -        base = getAttributeNS(doc.documentElement, 'http://www.w3.org/XML/1998/namespace', 'base') || $.uri.base();
      -        for (i = 0; i < doc.documentElement.childNodes.length; i += 1) {
      -          d = doc.documentElement.childNodes[i];
      -          if (d.nodeType === 1) {
      -            triples = triples.concat(parseRdfXmlDescription(d, true, base, lang));
      -          }
      -        }
      -      } else {
      -        triples = parseRdfXmlDescription(doc.documentElement, true);
      -      }
      -      return triples;
      -    };
      -
      -  $.typedValue.types['http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral'] = {
      -    regex: /^.*$/m,
      -    strip: false,
      -    value: function (v) {
      -      return v;
      -    }
      -  };
      -
      -  /**
      -   * <p>Creates a new jQuery.rdf object. This should be invoked as a method rather than constructed using new; indeed you will usually want to generate these objects using a method such as {@link jQuery#rdf} or {@link jQuery.rdf#where}.</p>
      -   * @class <p>A jQuery.rdf object represents the results of a query over its {@link jQuery.rdf#databank}. The results of a query are a sequence of objects which represent the bindings of values to the variables used in filter expressions specified using {@link jQuery.rdf#where} or {@link jQuery.rdf#optional}. Each of the objects in this sequence has associated with it a set of triples that are the sources for the variable bindings, which you can get at using {@link jQuery.rdf#sources}.</p>
      -    * <p>The {@link jQuery.rdf} object itself is a lot like a {@link jQuery} object. It has a {@link jQuery.rdf#length} and the individual matches can be accessed using <code>[<var>n</var>]</code>, but you can also iterate through the matches using {@link jQuery.rdf#map} or {@link jQuery.rdf#each}.</p>
      -    * <p>{@link jQuery.rdf} is designed to mirror the functionality of <a href="http://www.w3.org/TR/rdf-sparql-query/">SPARQL</a> while providing an interface that's familiar and easy to use for jQuery programmers.</p>
      -   * @param {Object} [options]
      -   * @param {jQuery.rdf.databank} [options.databank] The databank that this query should operate over.
      -   * @param {jQuery.rdf.triple[]} [options.triples] A set of triples over which the query operates; this is only used if options.databank isn't specified, in which case a new databank with these triples is generated.
      -   * @param {Object} [options.namespaces] An object representing a set of namespace bindings. Rather than passing this in when you construct the {@link jQuery.rdf} instance, you will usually want to use the {@link jQuery.rdf#prefix} method.
      -   * @param {String|jQuery.uri} [options.base] The base URI used to interpret any relative URIs used within the query.
      -   * @returns {jQuery.rdf}
      -   * @example rdf = jQuery.rdf();
      -   * @see jQuery#rdf
      -   */
      -  $.rdf = function (options) {
      -    return new $.rdf.fn.init(options);
      -  };
      -
      -  $.rdf.fn = $.rdf.prototype = {
      -    /**
      -     * The version of rdfQuery.
      -     * @type String
      -     */
      -    rdfquery: '0.9',
      -
      -    init: function (options) {
      -      var databanks;
      -      options = options || {};
      -      /* must specify either a parent or a union, otherwise it's the top */
      -      this.parent = options.parent;
      -      this.union = options.union;
      -      this.top = this.parent === undefined && this.union === undefined;
      -      if (this.union === undefined) {
      -        if (options.databank === undefined) {
      -          /**
      -           * The databank over which this query operates.
      -           * @type jQuery.rdf.databank
      -           */
      -          this.databank = this.parent === undefined ? $.rdf.databank(options.triples, options) : this.parent.databank;
      -        } else {
      -          this.databank = options.databank;
      -        }
      -      } else {
      -        databanks = $.map(this.union, function (query) {
      -          return query.databank;
      -        });
      -        databanks = $.unique(databanks);
      -        if (databanks[1] !== undefined) {
      -          this.databank = $.rdf.databank(undefined, { union: databanks });
      -        } else {
      -          this.databank = databanks[0];
      -        }
      -      }
      -      this.children = [];
      -      this.partOf = [];
      -      this.filterExp = options.filter;
      -      this.alphaMemory = [];
      -      this.matches = [];
      -      /**
      -       * The number of matches represented by the {@link jQuery.rdf} object.
      -       * @type Integer
      -       */
      -      this.length = 0;
      -      if (this.filterExp !== undefined) {
      -        if (!$.isFunction(this.filterExp)) {
      -          registerQuery(this.databank, this);
      -          this.alphaMemory = findMatches(this.databank.triples(), this.filterExp);
      -        }
      -      }
      -      leftActivate(this);
      -      return this;
      -    },
      -
      -    /**
      -     * Sets or returns the base URI of the {@link jQuery.rdf#databank}.
      -     * @param {String|jQuery.uri} [base]
      -     * @returns A {@link jQuery.uri} if no base URI is specified, otherwise returns this {@link jQuery.rdf} object.
      -     * @example baseURI = jQuery('html').rdf().base();
      -     * @example jQuery('html').rdf().base('http://www.example.org/');
      -     * @see jQuery.rdf.databank#base
      -     */
      -    base: function (base) {
      -      if (base === undefined) {
      -        return this.databank.base();
      -      } else {
      -        this.databank.base(base);
      -        return this;
      -      }
      -    },
      -
      -    /**
      -     * Sets or returns a namespace binding on the {@link jQuery.rdf#databank}.
      -     * @param {String} [prefix]
      -     * @param {String} [namespace]
      -     * @returns {Object|jQuery.uri|jQuery.rdf} If no prefix or namespace is specified, returns an object providing all namespace bindings on the {@link jQuery.rdf.databank}. If a prefix is specified without a namespace, returns the {@link jQuery.uri} associated with that prefix. Otherwise returns this {@link jQuery.rdf} object after setting the namespace binding.
      -     * @example namespace = jQuery('html').rdf().prefix('foaf');
      -     * @example jQuery('html').rdf().prefix('foaf', 'http://xmlns.com/foaf/0.1/');
      -     * @see jQuery.rdf.databank#prefix
      -     */
      -    prefix: function (prefix, namespace) {
      -      if (namespace === undefined) {
      -        return this.databank.prefix(prefix);
      -      } else {
      -        this.databank.prefix(prefix, namespace);
      -        return this;
      -      }
      -    },
      -
      -    /**
      -     * Adds a triple to the {@link jQuery.rdf#databank} or another {@link jQuery.rdf} object to create a union.
      -     * @param {String|jQuery.rdf.triple|jQuery.rdf.pattern|jQuery.rdf} triple The triple, {@link jQuery.rdf.pattern} or {@link jQuery.rdf} object to be added to this one. If the triple is a {@link jQuery.rdf} object, the two queries are unioned together. If the triple is a string, it's parsed as a {@link jQuery.rdf.pattern}. The pattern will be completed using the current matches on the {@link jQuery.rdf} object to create multiple triples, one for each set of bindings.
      -     * @param {Object} [options]
      -     * @param {Object} [options.namespaces] An object representing a set of namespace bindings used to interpret CURIEs within the triple. Defaults to the namespace bindings defined on the {@link jQuery.rdf#databank}.
      -     * @param {String|jQuery.uri} [options.base] The base URI used to interpret any relative URIs used within the triple. Defaults to the base URI defined on the {@link jQuery.rdf#databank}.
      -     * @returns {jQuery.rdf} This {@link jQuery.rdf} object.
      -     * @example
      -     * var rdf = $.rdf()
      -     *   .prefix('dc', ns.dc)
      -     *   .prefix('foaf', ns.foaf)
      -     *   .add('&lt;photo1.jpg> dc:creator &lt;http://www.blogger.com/profile/1109404> .')
      -     *   .add('&lt;http://www.blogger.com/profile/1109404> foaf:img &lt;photo1.jpg> .');
      -     * @example
      -     * var rdfA = $.rdf()
      -     *   .prefix('dc', ns.dc)
      -     *   .add('&lt;photo1.jpg> dc:creator "Jane"');
      -     * var rdfB = $.rdf()
      -     *   .prefix('foaf', ns.foaf)
      -     *   .add('&lt;photo1.jpg> foaf:depicts "Jane"');
      -     * var rdf = rdfA.add(rdfB);
      -     * @see jQuery.rdf.databank#add
      -     */
      -    add: function (triple, options) {
      -      var query, databank;
      -      if (triple.rdfquery !== undefined) {
      -        if (triple.top) {
      -          databank = this.databank.add(triple.databank);
      -          query = $.rdf({ parent: this.parent, databank: databank });
      -          return query;
      -        } else if (this.top) {
      -          databank = triple.databank.add(this.databank);
      -          query = $.rdf({ parent: triple.parent, databank: databank });
      -          return query;
      -        } else if (this.union === undefined) {
      -          query = $.rdf({ union: [this, triple] });
      -          this.partOf.push(query);
      -          triple.partOf.push(query);
      -          return query;
      -        } else {
      -          this.union.push(triple);
      -          triple.partOf.push(this);
      -        }
      -      } else {
      -        if (typeof triple === 'string') {
      -          options = $.extend({}, { base: this.base(), namespaces: this.prefix(), source: triple }, options);
      -          triple = $.rdf.pattern(triple, options);
      -        }
      -        if (triple.isFixed()) {
      -          this.databank.add(triple.triple(), options);
      -        } else {
      -          query = this;
      -          this.each(function (i, data) {
      -            var t = triple.triple(data);
      -            if (t !== null) {
      -              query.databank.add(t, options);
      -            }
      -          });
      -        }
      -      }
      -      return this;
      -    },
      -
      -    /**
      -     * Removes a triple or several triples from the {@link jQuery.rdf#databank}.
      -     * @param {String|jQuery.rdf.triple|jQuery.rdf.pattern} triple The triple to be removed, or a {@link jQuery.rdf.pattern} that matches the triples that should be removed.
      -     * @param {Object} [options]
      -     * @param {Object} [options.namespaces] An object representing a set of namespace bindings used to interpret any CURIEs within the triple or pattern. Defaults to the namespace bindings defined on the {@link jQuery.rdf#databank}.
      -     * @param {String|jQuery.uri} [options.base] The base URI used to interpret any relative URIs used within the triple or pattern. Defaults to the base URI defined on the {@link jQuery.rdf#databank}.
      -     * @returns {jQuery.rdf} The {@link jQuery.rdf} object itself.
      -     * @example
      -     * var rdf = $('html').rdf()
      -     *   .prefix('foaf', ns.foaf)
      -     *   .where('?person foaf:givenname ?gname')
      -     *   .where('?person foaf:family_name ?fname')
      -     *   .remove('?person foaf:family_name ?fname');
      -     * @see jQuery.rdf.databank#remove
      -     */
      -    remove: function (triple, options) {
      -      if (typeof triple === 'string') {
      -        options = $.extend({}, { base: this.base(), namespaces: this.prefix() }, options);
      -        triple = $.rdf.pattern(triple, options);
      -      }
      -      if (triple.isFixed()) {
      -        this.databank.remove(triple.triple(), options);
      -      } else {
      -        query = this;
      -        this.each(function (i, data) {
      -          var t = triple.triple(data);
      -          if (t !== null) {
      -            query.databank.remove(t, options);
      -          }
      -        });
      -      }
      -      return this;
      -    },
      -
      -    /**
      -     * Loads some data into the {@link jQuery.rdf#databank}
      -     * @param data
      -     * @param {Object} [options]
      -     * @see jQuery.rdf.databank#load
      -     */
      -    load: function (data, options) {
      -      this.databank.load(data, options);
      -      return this;
      -    },
      -
      -    /**
      -     * Creates a new {@link jQuery.rdf} object whose databank contains all the triples in this object's databank except for those in the argument's databank.
      -     * @param {jQuery.rdf} query
      -     * @see jQuery.rdf.databank#except
      -     */
      -    except: function (query) {
      -      return $.rdf({ databank: this.databank.except(query.databank) });
      -    },
      -
      -    /**
      -     * Creates a new {@link jQuery.rdf} object that is the result of filtering the matches on this {@link jQuery.rdf} object based on the filter that's passed into it.
      -     * @param {String|jQuery.rdf.pattern} filter An expression that filters the triples in the {@link jQuery.rdf#databank} to locate matches based on the matches on this {@link jQuery.rdf} object. If it's a string, the filter is parsed as a {@link jQuery.rdf.pattern}.
      -     * @param {Object} [options]
      -     * @param {Object} [options.namespaces] An object representing a set of namespace bindings used to interpret any CURIEs within the pattern. Defaults to the namespace bindings defined on the {@link jQuery.rdf#databank}.
      -     * @param {String|jQuery.uri} [options.base] The base URI used to interpret any relative URIs used within the pattern. Defaults to the base URI defined on the {@link jQuery.rdf#databank}.
      -     * @param {boolean} [options.optional] Not usually used (use {@link jQuery.rdf#optional} instead).
      -     * @returns {jQuery.rdf} A new {@link jQuery.rdf} object whose {@link jQuery.rdf#parent} is this {@link jQuery.rdf}.
      -     * @see jQuery.rdf#optional
      -     * @see jQuery.rdf#filter
      -     * @see jQuery.rdf#about
      -     * @example
      -     * var rdf = $.rdf()
      -     *   .prefix('foaf', ns.foaf)
      -     *   .add('_:a foaf:givenname   "Alice" .')
      -     *   .add('_:a foaf:family_name "Hacker" .')
      -     *   .add('_:b foaf:givenname   "Bob" .')
      -     *   .add('_:b foaf:family_name "Hacker" .')
      -     *   .where('?person foaf:family_name "Hacker"')
      -     *   .where('?person foaf:givenname "Bob");
      -     */ 
      -    where: function (filter, options) {
      -      var query, base, namespaces, optional;
      -      options = options || {};
      -      if (typeof filter === 'string') {
      -        base = options.base || this.base();
      -        namespaces = $.extend({}, this.prefix(), options.namespaces || {});
      -        optional = options.optional || false;
      -        filter = $.rdf.pattern(filter, { namespaces: namespaces, base: base, optional: optional });
      -      }
      -      query = $.rdf($.extend({}, options, { parent: this, filter: filter }));
      -      this.children.push(query);
      -      return query;
      -    },
      -
      -    /**
      -     * Creates a new {@link jQuery.rdf} object whose set of bindings might optionally include those based on the filter pattern.
      -     * @param {String|jQuery.rdf.pattern} filter An pattern for a set of bindings that might be added to those in this {@link jQuery.rdf} object.
      -     * @param {Object} [options]
      -     * @param {Object} [options.namespaces] An object representing a set of namespace bindings used to interpret any CURIEs within the pattern. Defaults to the namespace bindings defined on the {@link jQuery.rdf#databank}.
      -     * @param {String|jQuery.uri} [options.base] The base URI used to interpret any relative URIs used within the pattern. Defaults to the base URI defined on the {@link jQuery.rdf#databank}.
      -     * @returns {jQuery.rdf} A new {@link jQuery.rdf} object whose {@link jQuery.rdf#parent} is this {@link jQuery.rdf}.
      -     * @see jQuery.rdf#where
      -     * @see jQuery.rdf#filter
      -     * @see jQuery.rdf#about
      -     * @example
      -     * var rdf = $.rdf()
      -     *   .prefix('foaf', 'http://xmlns.com/foaf/0.1/')
      -     *   .prefix('rdf', 'http://www.w3.org/1999/02/22-rdf-syntax-ns#')
      -     *   .add('_:a  rdf:type        foaf:Person .')
      -     *   .add('_:a  foaf:name       "Alice" .')
      -     *   .add('_:a  foaf:mbox       &lt;mailto:alice@example.com> .')
      -     *   .add('_:a  foaf:mbox       &lt;mailto:alice@work.example> .')
      -     *   .add('_:b  rdf:type        foaf:Person .')
      -     *   .add('_:b  foaf:name       "Bob" .')
      -     *   .where('?x foaf:name ?name')
      -     *   .optional('?x foaf:mbox ?mbox');
      -     */
      -    optional: function (filter, options) {
      -      return this.where(filter, $.extend({}, options || {}, { optional: true }));
      -    },
      -
      -    /**
      -     * Creates a new {@link jQuery.rdf} object whose set of bindings include <code>property</code> and <code>value</code> for every triple that is about the specified resource.
      -     * @param {String|jQuery.rdf.resource} resource The subject of the matching triples.
      -     * @param {Object} [options]
      -     * @param {Object} [options.namespaces] An object representing a set of namespace bindings used to interpret the resource if it's a CURIE. Defaults to the namespace bindings defined on the {@link jQuery.rdf#databank}.
      -     * @param {String|jQuery.uri} [options.base] The base URI used to interpret the resource if it's a relative URI (wrapped in <code>&lt;</code> and <code>&gt;</code>). Defaults to the base URI defined on the {@link jQuery.rdf#databank}.
      -     * @returns {jQuery.rdf} A new {@link jQuery.rdf} object whose {@link jQuery.rdf#parent} is this {@link jQuery.rdf}.
      -     * @see jQuery.rdf#where
      -     * @see jQuery.rdf#optional
      -     * @see jQuery.rdf#filter
      -     * @example
      -     * var rdf = $.rdf()
      -     *   .prefix('dc', ns.dc)
      -     *   .prefix('foaf', ns.foaf)
      -     *   .add('&lt;photo1.jpg> dc:creator &lt;http://www.blogger.com/profile/1109404> .')
      -     *   .add('&lt;http://www.blogger.com/profile/1109404> foaf:img &lt;photo1.jpg> .')
      -     *   .add('&lt;photo2.jpg> dc:creator &lt;http://www.blogger.com/profile/1109404> .')
      -     *   .add('&lt;http://www.blogger.com/profile/1109404> foaf:img &lt;photo2.jpg> .')
      -     *   .about('&lt;http://www.blogger.com/profile/1109404>');
      -     */
      -    about: function (resource, options) {
      -      return this.where(resource + ' ?property ?value', options);
      -    },
      -
      -    /**
      -     * Creates a new {@link jQuery.rdf} object whose set of bindings include only those that satisfy some arbitrary condition. There are two main ways to call this method: with two arguments in which case the first is a binding to be tested and the second represents a condition on the test, or with one argument which is a function that should return true for acceptable bindings.
      -     * @param {Function|String} property <p>In the two-argument version, this is the name of a property to be tested against the condition specified in the second argument. In the one-argument version, this is a function in which <code>this</code> is an object whose properties are a set of {@link jQuery.rdf.resource}, {@link jQuery.rdf.literal} or {@link jQuery.rdf.blank} objects and whose arguments are:</p>
      -     * <dl>
      -     *   <dt>i</dt>
      -     *   <dd>The index of the set of bindings amongst the other matches</dd>
      -     *   <dt>bindings</dt>
      -     *   <dd>An object representing the bindings (the same as <code>this</code>)</dd>
      -     *   <dt>triples</dt>
      -     *   <dd>The {@link jQuery.rdf.triple}s that underly this set of bindings</dd>
      -     * </dl>
      -     * @param {RegExp|String} condition In the two-argument version of this function, the condition that the property's must match. If it is a regular expression, the value must match the regular expression. If it is a {@link jQuery.rdf.literal}, the value of the literal must match the property's value. Otherwise, they must be the same resource.
      -     * @returns {jQuery.rdf} A new {@link jQuery.rdf} object whose {@link jQuery.rdf#parent} is this {@link jQuery.rdf}.
      -     * @see jQuery.rdf#where
      -     * @see jQuery.rdf#optional
      -     * @see jQuery.rdf#about
      -     * @example
      -     * var rdf = $.rdf()
      -     *   .prefix('foaf', 'http://xmlns.com/foaf/0.1/')
      -     *   .add('_:a foaf:surname "Jones" .')
      -     *   .add('_:b foaf:surname "Macnamara" .')
      -     *   .add('_:c foaf:surname "O\'Malley"')
      -     *   .add('_:d foaf:surname "MacFee"')
      -     *   .where('?person foaf:surname ?surname')
      -     *     .filter('surname', /^Ma?c/)
      -     *       .each(function () { scottish.push(this.surname.value); })
      -     *     .end()
      -     *     .filter('surname', /^O'/)
      -     *       .each(function () { irish.push(this.surname.value); })
      -     *     .end();
      -     * @example
      -     * var rdf = $.rdf()
      -     *   .prefix('foaf', 'http://xmlns.com/foaf/0.1/')
      -     *   .add('_:a foaf:surname "Jones" .')
      -     *   .add('_:b foaf:surname "Macnamara" .')
      -     *   .add('_:c foaf:surname "O\'Malley"')
      -     *   .add('_:d foaf:surname "MacFee"')
      -     *   .where('?person foaf:surname ?surname')
      -     *   .filter(function () { return this.surname !== "Jones"; })
      -     */
      -    filter: function (property, condition) {
      -      var func, query;
      -      if (typeof property === 'string') {
      -        if (condition.constructor === RegExp) {
      -          /** @ignore func */
      -          func = function () {
      -            return condition.test(this[property].value);
      -          };
      -        } else {
      -          func = function () {
      -            return this[property].type === 'literal' ? this[property].value === condition : this[property] === condition;
      -          };
      -        }
      -      } else {
      -        func = property;
      -      }
      -      query = $.rdf({ parent: this, filter: func });
      -      this.children.push(query);
      -      return query;
      -    },
      -
      -    /**
      -     * Filters the variable bindings held by this {@link jQuery.rdf} object down to those listed in the bindings parameter. This mirrors the <a href="http://www.w3.org/TR/rdf-sparql-query/#select">SELECT</a> form in SPARQL.
      -     * @param {String[]} [bindings] The variables that you're interested in. The returned objects will only contain those variables. If bindings is undefined, you will get all the variable bindings in the returned objects.
      -     * @returns {Object[]} An array of objects with the properties named by the bindings parameter.
      -     * @example
      -     * var filtered = rdf
      -     *   .where('?photo dc:creator ?creator')
      -     *   .where('?creator foaf:img ?photo');
      -     * var selected = rdf.select(['creator']);
      -     */
      -    select: function (bindings) {
      -      var s = [], i, j;
      -      for (i = 0; i < this.length; i += 1) {
      -        if (bindings === undefined) {
      -          s[i] = this[i];
      -        } else {
      -          s[i] = {};
      -          for (j = 0; j < bindings.length; j += 1) {
      -            s[i][bindings[j]] = this[i][bindings[j]];
      -          }
      -        }
      -      }
      -      return s;
      -    },
      -
      -    /**
      -     * Provides <a href="http://n2.talis.com/wiki/Bounded_Descriptions_in_RDF#Simple_Concise_Bounded_Description">simple concise bounded descriptions</a> of the resources or bindings that are passed in the argument. This mirrors the <a href="http://www.w3.org/TR/rdf-sparql-query/#describe">DESCRIBE</a> form in SPARQL.
      -     * @param {(String|jQuery.rdf.resource)[]} bindings An array that can contain strings, {@link jQuery.rdf.resource}s or a mixture of the two. Any strings that begin with a question mark (<code>?</code>) are taken as variable names; each matching resource is described by the function.
      -     * @returns {jQuery} A {@link jQuery} object that contains {@link jQuery.rdf.triple}s that describe the listed resources.
      -     * @see jQuery.rdf.databank#describe
      -     * @example
      -     * $.rdf.dump($('html').rdf().describe(['<photo1.jpg>']));
      -     * @example
      -     * $('html').rdf()
      -     *   .where('?person foaf:img ?picture')
      -     *   .describe(['?photo'])
      -     */
      -    describe: function (bindings) {
      -      var i, j, binding, resources = [];
      -      for (i = 0; i < bindings.length; i += 1) {
      -        binding = bindings[i];
      -        if (binding.substring(0, 1) === '?') {
      -          binding = binding.substring(1);
      -          for (j = 0; j < this.length; j += 1) {
      -            resources.push(this[j][binding]);
      -          }
      -        } else {
      -          resources.push(binding);
      -        }
      -      }
      -      return this.databank.describe(resources);
      -    },
      -
      -    /**
      -     * Returns a new {@link jQuery.rdf} object that contains only one set of variable bindings. This is designed to mirror the <a href="http://docs.jquery.com/Traversing/eq#index">jQuery#eq</a> method.
      -     * @param {Integer} n The index number of the match that should be selected.
      -     * @returns {jQuery.rdf} A new {@link jQuery.rdf} object with just that match.
      -     * @example
      -     * var rdf = $.rdf()
      -     *   .prefix('foaf', 'http://xmlns.com/foaf/0.1/')
      -     *   .add('_:a  foaf:name       "Alice" .')
      -     *   .add('_:a  foaf:homepage   <http://work.example.org/alice/> .')
      -     *   .add('_:b  foaf:name       "Bob" .')
      -     *   .add('_:b  foaf:mbox       <mailto:bob@work.example> .')
      -     *   .where('?x foaf:name ?name')
      -     *   .eq(1);
      -     */
      -    eq: function (n) {
      -      return this.filter(function (i) {
      -        return i === n;
      -      });
      -    },
      -
      -    /**
      -     * Returns a {@link jQuery.rdf} object that includes no filtering (and therefore has no matches) over the {@link jQuery.rdf#databank}.
      -     * @returns {jQuery.rdf} An empty {@link jQuery.rdf} object.
      -     * @example
      -     * $('html').rdf()
      -     *   .where('?person foaf:family_name "Hacker"')
      -     *   .where('?person foaf:givenname "Alice"')
      -     *   .each(...do something with Alice Hacker...)
      -     *   .reset()
      -     *   .where('?person foaf:family_name "Jones"')
      -     *   .where('?person foaf:givenname "Bob"')
      -     *   .each(...do something with Bob Jones...);
      -     */
      -    reset: function () {
      -      var query = this;
      -      while (query.parent !== undefined) {
      -        query = query.parent;
      -      }
      -      return query;
      -    },
      -
      -    /**
      -     * Returns the parent {@link jQuery.rdf} object, which is equivalent to undoing the most recent filtering operation (such as {@link jQuery.rdf#where} or {@link jQuery.rdf#filter}). This is designed to mirror the <a href="http://docs.jquery.com/Traversing/end">jQuery#end</a> method.
      -     * @returns {jQuery.rdf}
      -     * @example
      -     * $('html').rdf()
      -     *   .where('?person foaf:family_name "Hacker"')
      -     *   .where('?person foaf:givenname "Alice"')
      -     *   .each(...do something with Alice Hacker...)
      -     *   .end()
      -     *   .where('?person foaf:givenname "Bob"')
      -     *   .each(...do something with Bob Hacker...);
      -     */
      -    end: function () {
      -      return this.parent;
      -    },
      -
      -    /**
      -     * Returns the number of matches in this {@link jQuery.rdf} object (equivalent to {@link jQuery.rdf#length}).
      -     * @returns {Integer} The number of matches in this {@link jQuery.rdf} object.
      -     * @see jQuery.rdf#length
      -     */
      -    size: function () {
      -      return this.length;
      -    },
      -
      -    /**
      -     * Gets the triples that form the basis of the variable bindings that are the primary product of {@link jQuery.rdf}. Getting hold of the triples can be useful for understanding the facts that form the basis of the variable bindings.
      -     * @returns {jQuery} A {@link jQuery} object containing arrays of {@link jQuery.rdf.triple} objects. A {@link jQuery} object is returned so that you can easily iterate over the contents.
      -     * @example
      -     * $('html').rdf()
      -     *   .where('?thing a foaf:Person')
      -     *   .sources()
      -     *   .each(function () {
      -     *     ...do something with the array of triples... 
      -     *   });
      -     */
      -    sources: function () {
      -      return $($.map(this.matches, function (match) {
      -        // return an array-of-an-array because arrays automatically get expanded by $.map()
      -        return [match.triples];
      -      }));
      -    },
      -
      -    /**
      -     * Dumps the triples that form the basis of the variable bindings that are the primary product of {@link jQuery.rdf} into a format that can be shown to the user or sent to a server.
      -     * @param {Object} [options] Options that control the formatting of the triples. See {@link jQuery.rdf.dump} for details.
      -     * @see jQuery.rdf.dump
      -     */
      -    dump: function (options) {
      -      var triples = $.map(this.matches, function (match) {
      -        return match.triples;
      -      });
      -      options = $.extend({ namespaces: this.databank.namespaces, base: this.databank.base }, options || {});
      -      return $.rdf.dump(triples, options);
      -    },
      -
      -    /**
      -     * Either returns the item specified by the argument or turns the {@link jQuery.rdf} object into an array. This mirrors the <a href="http://docs.jquery.com/Core/get">jQuery#get</a> method.
      -     * @param {Integer} [num] The number of the item to be returned.
      -     * @returns {Object[]|Object} Returns either a single Object representing variable bindings or an array of such.
      -     * @example
      -     * $('html').rdf()
      -     *   .where('?person a foaf:Person')
      -     *   .get(0)
      -     *   .subject
      -     *   .value;
      -     */
      -    get: function (num) {
      -      return (num === undefined) ? $.makeArray(this) : this[num];
      -    },
      -
      -    /**
      -     * Iterates over the matches held by the {@link jQuery.rdf} object and performs a function on each of them. This mirrors the <a href="http://docs.jquery.com/Core/each">jQuery#each</a> method.
      -     * @param {Function} callback A function that is called for each match on the {@link jQuery.rdf} object. Within the function, <code>this</code> is set to the object representing the variable bindings. The function can take up to three parameters:
      -     * <dl>
      -     *   <dt>i</dt><dd>The index of the match amongst the other matches.</dd>
      -     *   <dt>bindings</dt><dd>An object representing the variable bindings for the match, the same as <code>this</code>.</dd>
      -     *   <dt>triples</dt><dd>An array of {@link jQuery.rdf.triple}s associated with the particular match.</dd>
      -     * </dl>
      -     * @returns {jQuery.rdf} The {@link jQuery.rdf} object.
      -     * @see jQuery.rdf#map
      -     * @example
      -     * var rdf = $('html').rdf()
      -     *   .where('?photo dc:creator ?creator')
      -     *   .where('?creator foaf:img ?photo')
      -     *   .each(function () {
      -     *     photos.push(this.photo.value);
      -     *   });
      -     */
      -    each: function (callback) {
      -      $.each(this.matches, function (i, match) {
      -        callback.call(match.bindings, i, match.bindings, match.triples);
      -      });
      -      return this;
      -    },
      -
      -    /**
      -     * Iterates over the matches held by the {@link jQuery.rdf} object and creates a new {@link jQuery} object that holds the result of applying the passed function to each one. This mirrors the <a href="http://docs.jquery.com/Traversing/map">jQuery#map</a> method.
      -     * @param {Function} callback A function that is called for each match on the {@link jQuery.rdf} object. Within the function, <code>this</code> is set to the object representing the variable bindings. The function can take up to three parameters and should return some kind of value:
      -     * <dl>
      -     *   <dt>i</dt><dd>The index of the match amongst the other matches.</dd>
      -     *   <dt>bindings</dt><dd>An object representing the variable bindings for the match, the same as <code>this</code>.</dd>
      -     *   <dt>triples</dt><dd>An array of {@link jQuery.rdf.triple}s associated with the particular match.</dd>
      -     * </dl>
      -     * @returns {jQuery} A jQuery object holding the results of the function for each of the matches on the original {@link jQuery.rdf} object.
      -     * @example
      -     * var photos = $('html').rdf()
      -     *   .where('?photo dc:creator ?creator')
      -     *   .where('?creator foaf:img ?photo')
      -     *   .map(function () {
      -     *     return this.photo.value;
      -     *   });
      -     */
      -    map: function (callback) {
      -      return $($.map(this.matches, function (match, i) {
      -        // in the callback, "this" is the bindings, and the arguments are swapped from $.map()
      -        return callback.call(match.bindings, i, match.bindings, match.triples);
      -      }));
      -    },
      -
      -    /**
      -     * Returns a {@link jQuery} object that wraps this {@link jQuery.rdf} object.
      -     * @returns {jQuery}
      -     */
      -    jquery: function () {
      -      return $(this);
      -    }
      -  };
      -
      -  $.rdf.fn.init.prototype = $.rdf.fn;
      -
      -  $.rdf.gleaners = [];
      -
      -  /**
      -   * Dumps the triples passed as the first argument into a format that can be shown to the user or sent to a server.
      -   * @param {jQuery.rdf.triple[]} triples An array (or {@link jQuery} object) of {@link jQuery.rdf.triple}s.
      -   * @param {Object} [options] Options that control the format of the dump.
      -   * @param {String} [options.format='application/json'] The mime type of the format of the dump. The supported formats are:
      -   * <table>
      -   *   <tr><th>mime type</th><th>description</th></tr>
      -   *   <tr>
      -   *     <td><code>application/json</code></td>
      -   *     <td>An <a href="http://n2.talis.com/wiki/RDF_JSON_Specification">RDF/JSON</a> object</td>
      -   *   </tr>
      -   *   <tr>
      -   *     <td><code>application/rdf+xml</code></td>
      -   *     <td>An DOMDocument node holding XML in <a href="http://www.w3.org/TR/rdf-syntax-grammar/">RDF/XML syntax</a></td>
      -   *   </tr>
      -   * </table>
      -   * @param {Object} [options.namespaces={}] A set of namespace bindings used when mapping resource URIs to CURIEs or QNames (particularly in a RDF/XML serialisation).
      -   * @param {boolean} [options.serialize=false] If true, rather than creating an Object, the function will return a string which is ready to display or send to a server.
      -   * @returns {Object|String} The alternative representation of the triples.
      -   */
      -  $.rdf.dump = function (triples, options) {
      -    var opts = $.extend({}, $.rdf.dump.defaults, options || {}),
      -      format = opts.format,
      -      serialize = opts.serialize,
      -      dump;
      -    if (format === 'application/json') {
      -      dump = createJson(triples, opts);
      -      return serialize ? $.toJSON(dump) : dump;
      -    } else if (format === 'application/rdf+xml') {
      -      dump = createRdfXml(triples, opts);
      -      if (serialize) {
      -        if (dump.xml) {
      -          return dump.xml.replace(/\s+$/,'');
      -        } else {
      -          serializer = new XMLSerializer();
      -          return serializer.serializeToString(dump);
      -        }
      -      } else {
      -        return dump;
      -      }
      -    } else {
      -      throw "Unrecognised dump format: " + format + ". Expected application/json or application/rdf+xml.";
      -    }
      -  };
      -
      -  $.rdf.dump.defaults = {
      -    format: 'application/json',
      -    serialize: false,
      -    namespaces: {}
      -  }
      -
      -  /**
      -   * Gleans RDF triples from the nodes held by the {@link jQuery} object, puts them into a {@link jQuery.rdf.databank} and returns a {@link jQuery.rdf} object that allows you to query and otherwise manipulate them. The mechanism for gleaning RDF triples from the web page depends on the rdfQuery modules that have been included. The core version of rdfQuery doesn't support any gleaners; other versions support a RDFa gleaner, and there are some modules available for common microformats.
      -   * @methodOf jQuery#
      -   * @name jQuery#rdf
      -   * @returns {jQuery.rdf} An empty query over the triples stored within the page.
      -   * @example $('#content').rdf().databank.dump();
      -   */
      -  $.fn.rdf = function () {
      -    var triples = [];
      -    if ($(this)[0] && $(this)[0].nodeType === 9) {
      -      return $(this).children('*').rdf();
      -    } else if ($(this).length > 0) {
      -      triples = $(this).map(function (i, elem) {
      -        return $.map($.rdf.gleaners, function (gleaner) {
      -          return gleaner.call($(elem));
      -        });
      -      });
      -      return $.rdf({ triples: triples, namespaces: $(this).xmlns() });
      -    } else {
      -      return $.rdf();
      -    }
      -  };
      -
      -  $.extend($.expr[':'], {
      -
      -    about: function (a, i, m) {
      -      var j = $(a),
      -        resource = m[3] ? j.safeCurie(m[3]) : null,
      -        isAbout = false;
      -      $.each($.rdf.gleaners, function (i, gleaner) {
      -        isAbout = gleaner.call(j, { about: resource });
      -        if (isAbout) {
      -          return null;
      -        }
      -      });
      -      return isAbout;
      -    },
      -
      -    type: function (a, i, m) {
      -      var j = $(a),
      -        type = m[3] ? j.curie(m[3]) : null,
      -        isType = false;
      -      $.each($.rdf.gleaners, function (i, gleaner) {
      -        if (gleaner.call(j, { type: type })) {
      -          isType = true;
      -          return null;
      -        }
      -      });
      -      return isType;
      -    }
      -
      -  });
      -
      -
      -  /**
      -   * <p>Creates a new jQuery.rdf.databank object. This should be invoked as a method rather than constructed using new; indeed you will not usually want to generate these objects directly, but manipulate them through a {@link jQuery.rdf} object.</p>
      -   * @class Represents a triplestore, holding a bunch of {@link jQuery.rdf.triple}s.
      -   * @param {(String|jQuery.rdf.triple)[]} [triples=[]] An array of triples to store in the databank.
      -   * @param {Object} [options] Initialisation of the databank.
      -   * @param {Object} [options.namespaces] An object representing a set of namespace bindings used when interpreting the CURIEs in strings representing triples. Rather than passing this in when you construct the {@link jQuery.rdf.databank} instance, you will usually want to use the {@link jQuery.rdf.databank#prefix} method.
      -   * @param {String|jQuery.uri} [options.base] The base URI used to interpret any relative URIs used within the strings representing triples.
      -   * @returns {jQuery.rdf.databank} The newly-created databank.
      -   * @see jQuery.rdf
      -   */
      -  $.rdf.databank = function (triples, options) {
      -    return new $.rdf.databank.fn.init(triples, options);
      -  };
      -
      -  $.rdf.databank.fn = $.rdf.databank.prototype = {
      -    init: function (triples, options) {
      -      var i;
      -      triples = triples || [];
      -      options = options || {};
      -      this.id = databankID();
      -      if (options.union === undefined) {
      -        this.queries = {};
      -        this.tripleStore = {};
      -        this.objectStore = {};
      -        this.baseURI = options.base || $.uri.base();
      -        this.namespaces = $.extend({}, options.namespaces || {});
      -        for (i = 0; i < triples.length; i += 1) {
      -          this.add(triples[i]);
      -        }
      -      } else {
      -        this.union = options.union;
      -      }
      -      return this;
      -    },
      -    
      -    /**
      -     * Sets or returns the base URI of the {@link jQuery.rdf.databank}.
      -     * @param {String|jQuery.uri} [base]
      -     * @returns A {@link jQuery.uri} if no base URI is specified, otherwise returns this {@link jQuery.rdf.databank} object.
      -     * @see jQuery.rdf#base
      -     */
      -    base: function (base) {
      -      if (this.union === undefined) {
      -        if (base === undefined) {
      -          return this.baseURI;
      -        } else {
      -          this.baseURI = base;
      -          return this;
      -        }
      -      } else if (base === undefined) {
      -        return this.union[0].base();
      -      } else {
      -        $.each(this.union, function (i, databank) {
      -          databank.base(base);
      -        });
      -        return this;
      -      }
      -    },
      -
      -    /**
      -     * Sets or returns a namespace binding on the {@link jQuery.rdf.databank}.
      -     * @param {String} [prefix]
      -     * @param {String} [namespace]
      -     * @returns {Object|jQuery.uri|jQuery.rdf} If no prefix or namespace is specified, returns an object providing all namespace bindings on the {@link jQuery.rdf#databank}. If a prefix is specified without a namespace, returns the {@link jQuery.uri} associated with that prefix. Otherwise returns this {@link jQuery.rdf} object after setting the namespace binding.
      -     * @see jQuery.rdf#prefix
      -     */
      -    prefix: function (prefix, uri) {
      -      var namespaces = {};
      -      if (this.union === undefined) {
      -        if (prefix === undefined) {
      -          return this.namespaces;
      -        } else if (uri === undefined) {
      -          return this.namespaces[prefix];
      -        } else {
      -          this.namespaces[prefix] = uri;
      -          return this;
      -        }
      -      } else if (uri === undefined) {
      -        $.each(this.union, function (i, databank) {
      -          $.extend(namespaces, databank.prefix());
      -        });
      -        if (prefix === undefined) {
      -          return namespaces;
      -        } else {
      -          return namespaces[prefix];
      -        }
      -      } else {
      -        $.each(this.union, function (i, databank) {
      -          databank.prefix(prefix, uri);
      -        });
      -        return this;
      -      }
      -    },
      -
      -    /**
      -     * Adds a triple to the {@link jQuery.rdf.databank} or another {@link jQuery.rdf.databank} object to create a union.
      -     * @param {String|jQuery.rdf.triple|jQuery.rdf.databank} triple The triple or {@link jQuery.rdf.databank} object to be added to this one. If the triple is a {@link jQuery.rdf.databank} object, the two databanks are unioned together. If the triple is a string, it's parsed as a {@link jQuery.rdf.triple}.
      -     * @param {Object} [options]
      -     * @param {Object} [options.namespaces] An object representing a set of namespace bindings used to interpret CURIEs within the triple. Defaults to the namespace bindings defined on the {@link jQuery.rdf.databank}.
      -     * @param {String|jQuery.uri} [options.base] The base URI used to interpret any relative URIs used within the triple. Defaults to the base URI defined on the {@link jQuery.rdf.databank}.
      -     * @returns {jQuery.rdf.databank} This {@link jQuery.rdf.databank} object.
      -     * @see jQuery.rdf#add
      -     */
      -    add: function (triple, options) {
      -      var base = (options && options.base) || this.base(),
      -        namespaces = $.extend({}, this.prefix(), (options && options.namespaces) || {}),
      -        databank;
      -      if (triple === this) {
      -        return this;
      -      } else if (triple.tripleStore !== undefined) {
      -        // merging two databanks
      -        if (this.union === undefined) {
      -          databank = $.rdf.databank(undefined, { union: [this, triple] });
      -          return databank;
      -        } else {
      -          this.union.push(triple);
      -          return this;
      -        }
      -      } else {
      -        if (typeof triple === 'string') {
      -          triple = $.rdf.triple(triple, { namespaces: namespaces, base: base, source: triple });
      -        }
      -        if (this.union === undefined) {
      -          if (this.tripleStore[triple.subject] === undefined) {
      -            this.tripleStore[triple.subject] = [];
      -          }
      -          if ($.inArray(triple, this.tripleStore[triple.subject]) === -1) {
      -            this.tripleStore[triple.subject].push(triple);
      -            if (triple.object.type === 'uri' || triple.object.type === 'bnode') {
      -              if (this.objectStore[triple.object] === undefined) {
      -                this.objectStore[triple.object] = [];
      -              }
      -              this.objectStore[triple.object].push(triple);
      -            }
      -            addToDatabankQueries(this, triple);
      -          }
      -        } else {
      -          $.each(this.union, function (i, databank) {
      -            databank.add(triple);
      -          });
      -        }
      -        return this;
      -      }
      -    },
      -
      -    /**
      -     * Removes a triple from the {@link jQuery.rdf.databank}.
      -     * @param {String|jQuery.rdf.triple} triple The triple to be removed.
      -     * @param {Object} [options]
      -     * @param {Object} [options.namespaces] An object representing a set of namespace bindings used to interpret any CURIEs within the triple. Defaults to the namespace bindings defined on the {@link jQuery.rdf.databank}.
      -     * @param {String|jQuery.uri} [options.base] The base URI used to interpret any relative URIs used within the triple. Defaults to the base URI defined on the {@link jQuery.rdf.databank}.
      -     * @returns {jQuery.rdf.databank} The {@link jQuery.rdf.databank} object itself.
      -     * @see jQuery.rdf#remove
      -     */
      -    remove: function (triple, options) {
      -      var base = (options && options.base) || this.base(),
      -        namespaces = $.extend({}, this.prefix(), (options && options.namespaces) || {}),
      -        striples, otriples,
      -        databank;
      -      if (typeof triple === 'string') {
      -        triple = $.rdf.triple(triple, { namespaces: namespaces, base: base, source: triple });
      -      }
      -      striples = this.tripleStore[triple.subject];
      -      if (striples !== undefined) {
      -        striples.splice($.inArray(triple, striples), 1);
      -      }
      -      if (triple.object.type === 'uri' || triple.object.type === 'bnode') {
      -        otriples = this.objectStore[triple.object];
      -        if (otriples !== undefined) {
      -          otriples.splice($.inArray(triple, otriples), 1);
      -        }
      -      }
      -      removeFromDatabankQueries(this, triple);
      -      return this;
      -    },
      -
      -    /**
      -     * Creates a new databank containing all the triples in this {@link jQuery.rdf.databank} except those in the {@link jQuery.rdf.databank} passed as the argument.
      -     * @param {jQuery.rdf.databank} data The other {@link jQuery.rdf.databank}
      -     * @returns {jQuery.rdf.databank} A new {@link jQuery.rdf.databank} containing the triples in this {@link jQuery.rdf.databank} except for those in the data parameter.
      -     * @example
      -     * var old = $('html').rdf().databank;
      -     * ...some processing occurs...
      -     * var new = $('html').rdf().databank;
      -     * var added = new.except(old);
      -     * var removed = old.except(new);
      -     */
      -    except: function (data) {
      -      var store = data.tripleStore,
      -        diff = [];
      -      $.each(this.tripleStore, function (s, ts) {
      -        var ots = store[s];
      -        if (ots === undefined) {
      -          diff = diff.concat(ts);
      -        } else {
      -          $.each(ts, function (i, t) {
      -            if ($.inArray(t, ots) === -1) {
      -              diff.push(t);
      -            }
      -          });
      -        }
      -      });
      -      return $.rdf.databank(diff);
      -    },
      -
      -    /**
      -     * Provides a {@link jQuery} object containing the triples held in this {@link jQuery.rdf.databank}.
      -     * @returns {jQuery} A {@link jQuery} object containing {@link jQuery.rdf.triple} objects.
      -     */
      -    triples: function () {
      -      var triples = [];
      -      if (this.union === undefined) {
      -        $.each(this.tripleStore, function (s, t) {
      -          triples = triples.concat(t);
      -        });
      -      } else {
      -        $.each(this.union, function (i, databank) {
      -          triples = triples.concat(databank.triples().get());
      -        });
      -        triples = $.unique(triples);
      -      }
      -      return $(triples);
      -    },
      -
      -    /**
      -     * Tells you how many triples the databank contains.
      -     * @returns {Integer} The number of triples in the {@link jQuery.rdf.databank}.
      -     * @example $('html').rdf().databank.size();
      -     */
      -    size: function () {
      -      return this.triples().length;
      -    },
      -
      -    /**
      -     * Provides <a href="http://n2.talis.com/wiki/Bounded_Descriptions_in_RDF#Simple_Concise_Bounded_Description">simple concise bounded descriptions</a> of the resources that are passed in the argument. This mirrors the <a href="http://www.w3.org/TR/rdf-sparql-query/#describe">DESCRIBE</a> form in SPARQL.
      -     * @param {(String|jQuery.rdf.resource)[]} resources An array that can contain strings, {@link jQuery.rdf.resource}s or a mixture of the two.
      -     * @returns {jQuery} A {@link jQuery} object holding the {@link jQuery.rdf.triple}s that describe the listed resources.
      -     * @see jQuery.rdf#describe
      -     */
      -    describe: function (resources) {
      -      var i, r, t, rhash = {}, triples = [];
      -      while (resources.length > 0) {
      -        r = resources.pop();
      -        if (rhash[r] === undefined) {
      -          if (r.value === undefined) {
      -            r = $.rdf.resource(r);
      -          }
      -          if (this.tripleStore[r] !== undefined) {
      -            for (i = 0; i < this.tripleStore[r].length; i += 1) {
      -              t = this.tripleStore[r][i];
      -              triples.push(t);
      -              if (t.object.type === 'bnode') {
      -                resources.push(t.object);
      -              }
      -            }
      -          }
      -          if (this.objectStore[r] !== undefined) {
      -            for (i = 0; i < this.objectStore[r].length; i += 1) {
      -              t = this.objectStore[r][i];
      -              triples.push(t);
      -              if (t.subject.type === 'bnode') {
      -                resources.push(t.subject);
      -              }
      -            }
      -          }
      -          rhash[r] = true;
      -        }
      -      }
      -      return $.unique(triples);
      -    },
      -
      -    /**
      -     * Dumps the triples in the databank into a format that can be shown to the user or sent to a server.
      -     * @param {Object} [options] Options that control the formatting of the triples. See {@link jQuery.rdf.dump} for details.
      -     * @returns {Object|Node|String}
      -     * @see jQuery.rdf.dump
      -     */
      -    dump: function (options) {
      -      options = $.extend({ namespaces: this.namespaces, base: this.base }, options || {});
      -      return $.rdf.dump(this.triples(), options);
      -    },
      -
      -    /**
      -     * Loads some data into the databank.
      -     * @param {Node|Object} data If the data is a node, it's interpreted to be an <a href="http://www.w3.org/TR/rdf-syntax-grammar/">RDF/XML syntax</a> document and will be parsed as such. Otherwise, it's taken to be a <a href="http://n2.talis.com/wiki/RDF_JSON_Specification">RDF/JSON</a> object. The data cannot be a string; it must be parsed before it is passed to this function.
      -     * @returns {jQuery.rdf.databank} The {@link jQuery.rdf.databank} itself.
      -     * @see jQuery.rdf#load
      -     */
      -    load: function (data) {
      -      var i, triples;
      -      if (data.ownerDocument !== undefined) {
      -        triples = parseRdfXml(data);
      -      } else {
      -        triples = parseJson(data);
      -      }
      -      for (i = 0; i < triples.length; i += 1) {
      -        this.add(triples[i]);
      -      }
      -      return this;
      -    },
      -
      -    /**
      -     * Provides a string representation of the databank which simply specifies how many triples it contains.
      -     * @returns {String}
      -     */
      -    toString: function () {
      -      return '[Databank with ' + this.size() + ' triples]';
      -    }
      -  };
      -
      -  $.rdf.databank.fn.init.prototype = $.rdf.databank.fn;
      -
      -  /**
      -   * <p>Creates a new jQuery.rdf.pattern object. This should be invoked as a method rather than constructed using new; indeed you will not usually want to generate these objects directly, since they are automatically created from strings where necessary, such as by {@link jQuery.rdf#where}.</p>
      -   * @class Represents a pattern that may or may not match a given {@link jQuery.rdf.triple}.
      -   * @param {String|jQuery.rdf.resource|jQuery.rdf.blank} subject The subject pattern, or a single string that defines the entire pattern. If the subject is specified as a string, it can be a fixed resource (<code>&lt;<var>uri</var>&gt;</code> or <code><var>curie</var></code>), a blank node (<code>_:<var>id</var></code>) or a variable placeholder (<code>?<var>name</var></code>).
      -   * @param {String|jQuery.rdf.resource} [property] The property pattern. If the property is specified as a string, it can be a fixed resource (<code>&lt;<var>uri</var>&gt;</code> or <code><var>curie</var></code>) or a variable placeholder (<code>?<var>name</var></code>).
      -   * @param {String|jQuery.rdf.resource|jQuery.rdf.blank|jQuery.rdf.literal} [value] The value pattern. If the property is specified as a string, it can be a fixed resource (<code>&lt;<var>uri</var>&gt;</code> or <code><var>curie</var></code>), a blank node (<code>_:<var>id</var></code>), a literal (<code>"<var>value</var>"</code>) or a variable placeholder (<code>?<var>name</var></code>).
      -   * @param {Object} [options] Initialisation of the pattern.
      -   * @param {Object} [options.namespaces] An object representing a set of namespace bindings used when interpreting the CURIEs in the subject, property and object.
      -   * @param {String|jQuery.uri} [options.base] The base URI used to interpret any relative URIs used within the subject, property and object.
      -   * @param {boolean} [options.optional]
      -   * @returns {jQuery.rdf.pattern} The newly-created pattern.
      -   * @throws {String} Errors if any of the strings are not in a recognised format.
      -   * @example pattern = $.rdf.pattern('?person', $.rdf.type, 'foaf:Person', { namespaces: { foaf: "http://xmlns.com/foaf/0.1/" }});
      -   * @example 
      -   * pattern = $.rdf.pattern('?person a foaf:Person', { 
      -   *   namespaces: { foaf: "http://xmlns.com/foaf/0.1/" }, 
      -   *   optional: true 
      -   * });
      -   * @see jQuery.rdf#where
      -   * @see jQuery.rdf.resource
      -   * @see jQuery.rdf.blank
      -   * @see jQuery.rdf.literal
      -   */
      -  $.rdf.pattern = function (subject, property, object, options) {
      -    var pattern, m, optional;
      -    // using a two-argument version; first argument is a Turtle statement string
      -    if (object === undefined) {
      -      options = property || {};
      -      m = $.trim(subject).match(tripleRegex);
      -      if (m.length === 3 || (m.length === 4 && m[3] === '.')) {
      -        subject = m[0];
      -        property = m[1];
      -        object = m[2];
      -      } else {
      -        throw "Bad Pattern: Couldn't parse string " + subject;
      -      }
      -      optional = (options.optional === undefined) ? $.rdf.pattern.defaults.optional : options.optional;
      -    }
      -    if (memPattern[subject] && 
      -        memPattern[subject][property] && 
      -        memPattern[subject][property][object] && 
      -        memPattern[subject][property][object][optional]) {
      -      return memPattern[subject][property][object][optional];
      -    }
      -    pattern = new $.rdf.pattern.fn.init(subject, property, object, options);
      -    if (memPattern[pattern.subject] &&
      -        memPattern[pattern.subject][pattern.property] &&
      -        memPattern[pattern.subject][pattern.property][pattern.object] &&
      -        memPattern[pattern.subject][pattern.property][pattern.object][pattern.optional]) {
      -      return memPattern[pattern.subject][pattern.property][pattern.object][pattern.optional];
      -    } else {
      -      if (memPattern[pattern.subject] === undefined) {
      -        memPattern[pattern.subject] = {};
      -      }
      -      if (memPattern[pattern.subject][pattern.property] === undefined) {
      -        memPattern[pattern.subject][pattern.property] = {};
      -      }
      -      if (memPattern[pattern.subject][pattern.property][pattern.object] === undefined) {
      -        memPattern[pattern.subject][pattern.property][pattern.object] = {};
      -      }
      -      memPattern[pattern.subject][pattern.property][pattern.object][pattern.optional] = pattern;
      -      return pattern;
      -    }
      -  };
      -
      -  $.rdf.pattern.fn = $.rdf.pattern.prototype = {
      -    init: function (s, p, o, options) {
      -      var opts = $.extend({}, $.rdf.pattern.defaults, options);
      -      /**
      -       * The placeholder for the subject of triples matching against this pattern.
      -       * @type String|jQuery.rdf.resource|jQuery.rdf.blank
      -       */
      -      this.subject = s.toString().substring(0, 1) === '?' ? s : subject(s, opts);
      -      /**
      -       * The placeholder for the property of triples matching against this pattern.
      -       * @type String|jQuery.rdf.resource
      -       */
      -      this.property = p.toString().substring(0, 1) === '?' ? p : property(p, opts);
      -      /**
      -       * The placeholder for the object of triples matching against this pattern.
      -       * @type String|jQuery.rdf.resource|jQuery.rdf.blank|jQuery.rdf.literal
      -       */
      -      this.object = o.toString().substring(0, 1) === '?' ? o : object(o, opts);
      -      /**
      -       * Whether the pattern should only optionally match against the triple
      -       * @type boolean
      -       */
      -      this.optional = opts.optional;
      -      return this;
      -    },
      -
      -    /**
      -     * Creates a new {@link jQuery.rdf.pattern} with any variable placeholders within this one's subject, property or object filled in with values from the bindings passed as the argument.
      -     * @param {Object} bindings An object holding the variable bindings to be used to replace any placeholders in the pattern. These bindings are of the type held by the {@link jQuery.rdf} object.
      -     * @returns {jQuery.rdf.pattern} A new {@link jQuery.rdf.pattern} object.
      -     * @example
      -     * pattern = $.rdf.pattern('?thing a ?class');
      -     * // pattern2 matches all triples that indicate the classes of this page. 
      -     * pattern2 = pattern.fill({ thing: $.rdf.resource('<>') });
      -     */
      -    fill: function (bindings) {
      -      var s = this.subject,
      -        p = this.property,
      -        o = this.object;
      -      if (typeof s === 'string' && bindings[s.substring(1)]) {
      -        s = bindings[s.substring(1)];
      -      }
      -      if (typeof p === 'string' && bindings[p.substring(1)]) {
      -        p = bindings[p.substring(1)];
      -      }
      -      if (typeof o === 'string' && bindings[o.substring(1)]) {
      -        o = bindings[o.substring(1)];
      -      }
      -      return $.rdf.pattern(s, p, o, { optional: this.optional });
      -    },
      -
      -    /**
      -     * Creates a new Object holding variable bindings by matching the passed triple against this pattern.
      -     * @param {jQuery.rdf.triple} triple A {@link jQuery.rdf.triple} for this pattern to match against.
      -     * @returns {null|Object} An object containing the bindings of variables (as specified in this pattern) to values (as specified in the triple), or <code>null</code> if the triple doesn't match the pattern.
      -     * pattern = $.rdf.pattern('?thing a ?class');
      -     * bindings = pattern.exec($.rdf.triple('<> a foaf:Person', { namespaces: ns }));
      -     * thing = bindings.thing; // the resource for this page
      -     * class = bindings.class; // a resource for foaf:Person
      -     */
      -    exec: function (triple) {
      -      var binding = {};
      -      binding = testResource(triple.subject, this.subject, binding);
      -      if (binding === null) {
      -        return null;
      -      }
      -      binding = testResource(triple.property, this.property, binding);
      -      if (binding === null) {
      -        return null;
      -      }
      -      binding = testResource(triple.object, this.object, binding);
      -      return binding;
      -    },
      -
      -    /**
      -     * Tests whether this pattern has any variable placeholders in it or not.
      -     * @returns {boolean} True if the pattern doesn't contain any variable placeholders.
      -     * @example
      -     * $.rdf.pattern('?thing a ?class').isFixed(); // false
      -     * $.rdf.pattern('<> a foaf:Person', { namespaces: ns }).isFixed(); // true
      -     */
      -    isFixed: function () {
      -      return typeof this.subject !== 'string' &&
      -        typeof this.property !== 'string' &&
      -        typeof this.object !== 'string';
      -    },
      -
      -    /**
      -     * Creates a new triple based on the bindings passed to the pattern, if possible.
      -     * @param {Object} bindings An object holding the variable bindings to be used to replace any placeholders in the pattern. These bindings are of the type held by the {@link jQuery.rdf} object.
      -     * @returns {null|jQuery.rdf.triple} A new {@link jQuery.rdf.triple} object, or null if not all the variable placeholders in the pattern are specified in the bindings. The {@link jQuery.rdf.triple#source} of the generated triple is set to the string value of this pattern.
      -     * @example
      -     * pattern = $.rdf.pattern('?thing a ?class');
      -     * // triple is a new triple '<> a foaf:Person'
      -     * triple = pattern.triple({ 
      -     *   thing: $.rdf.resource('<>'),
      -     *   class: $.rdf.resource('foaf:Person', { namespaces: ns }) 
      -     * });
      -     */
      -    triple: function (bindings) {
      -      var t = this;
      -      if (!this.isFixed()) {
      -        t = this.fill(bindings);
      -      }
      -      if (t.isFixed()) {
      -        return $.rdf.triple(t.subject, t.property, t.object, { source: this.toString() });
      -      } else {
      -        return null;
      -      }
      -    },
      -
      -    /**
      -     * Returns a string representation of the pattern by concatenating the subject, property and object.
      -     * @returns {String}
      -     */
      -    toString: function () {
      -      return this.subject + ' ' + this.property + ' ' + this.object;
      -    }
      -  };
      -
      -  $.rdf.pattern.fn.init.prototype = $.rdf.pattern.fn;
      -
      -  $.rdf.pattern.defaults = {
      -    base: $.uri.base(),
      -    namespaces: {},
      -    optional: false
      -  };
      -
      -  /**
      -   * <p>Creates a new jQuery.rdf.triple object. This should be invoked as a method rather than constructed using new; indeed you will not usually want to generate these objects directly, since they are automatically created from strings where necessary, such as by {@link jQuery.rdf#add}.</p>
      -   * @class Represents an RDF triple.
      -   * @param {String|jQuery.rdf.resource|jQuery.rdf.blank} subject The subject of the triple, or a single string that defines the entire triple. If the subject is specified as a string, it can be a fixed resource (<code>&lt;<var>uri</var>&gt;</code> or <code><var>curie</var></code>) or a blank node (<code>_:<var>id</var></code>).
      -   * @param {String|jQuery.rdf.resource} [property] The property pattern. If the property is specified as a string, it must be a fixed resource (<code>&lt;<var>uri</var>&gt;</code> or <code><var>curie</var></code>).
      -   * @param {String|jQuery.rdf.resource|jQuery.rdf.blank|jQuery.rdf.literal} [value] The value pattern. If the property is specified as a string, it can be a fixed resource (<code>&lt;<var>uri</var>&gt;</code> or <code><var>curie</var></code>), a blank node (<code>_:<var>id</var></code>), or a literal (<code>"<var>value</var>"</code>).
      -   * @param {Object} [options] Initialisation of the triple.
      -   * @param {Object} [options.namespaces] An object representing a set of namespace bindings used when interpreting the CURIEs in the subject, property and object.
      -   * @param {String|jQuery.uri} [options.base] The base URI used to interpret any relative URIs used within the subject, property and object.
      -   * @returns {jQuery.rdf.triple} The newly-created triple.
      -   * @throws {String} Errors if any of the strings are not in a recognised format.
      -   * @example pattern = $.rdf.triple('<>', $.rdf.type, 'foaf:Person', { namespaces: { foaf: "http://xmlns.com/foaf/0.1/" }});
      -   * @example 
      -   * pattern = $.rdf.triple('<> a foaf:Person', { 
      -   *   namespaces: { foaf: "http://xmlns.com/foaf/0.1/" }
      -   * });
      -   * @see jQuery.rdf#add
      -   * @see jQuery.rdf.resource
      -   * @see jQuery.rdf.blank
      -   * @see jQuery.rdf.literal
      -   */
      -  $.rdf.triple = function (subject, property, object, options) {
      -    var triple, graph, m;
      -    // using a two-argument version; first argument is a Turtle statement string
      -    if (object === undefined) {
      -      options = property;
      -      m = $.trim(subject).match(tripleRegex);
      -      if (m.length === 3 || (m.length === 4 && m[3] === '.')) {
      -        subject = m[0];
      -        property = m[1];
      -        object = m[2];
      -      } else {
      -        throw "Bad Triple: Couldn't parse string " + subject;
      -      }
      -    }
      -    graph = (options && options.graph) || '';
      -    if (memTriple[graph] &&
      -        memTriple[graph][subject] &&
      -        memTriple[graph][subject][property] &&
      -        memTriple[graph][subject][property][object]) {
      -      return memTriple[graph][subject][property][object];
      -    }
      -    triple = new $.rdf.triple.fn.init(subject, property, object, options);
      -    graph = triple.graph || '';
      -    if (memTriple[graph] &&
      -        memTriple[graph][triple.subject] &&
      -        memTriple[graph][triple.subject][triple.property] &&
      -        memTriple[graph][triple.subject][triple.property][triple.object]) {
      -      return memTriple[graph][triple.subject][triple.property][triple.object];
      -    } else {
      -      if (memTriple[graph] === undefined) {
      -        memTriple[graph] = {};
      -      }
      -      if (memTriple[graph][triple.subject] === undefined) {
      -        memTriple[graph][triple.subject] = {};
      -      }
      -      if (memTriple[graph][triple.subject][triple.property] === undefined) {
      -        memTriple[graph][triple.subject][triple.property] = {};
      -      }
      -      memTriple[graph][triple.subject][triple.property][triple.object] = triple;
      -      return triple;
      -    }
      -  };
      -
      -  $.rdf.triple.fn = $.rdf.triple.prototype = {
      -    init: function (s, p, o, options) {
      -      var opts;
      -      opts = $.extend({}, $.rdf.triple.defaults, options);
      -      /**
      -       * The subject of the triple.
      -       * @type jQuery.rdf.resource|jQuery.rdf.blank
      -       */
      -      this.subject = subject(s, opts);
      -      /**
      -       * The property of the triple.
      -       * @type jQuery.rdf.resource
      -       */
      -      this.property = property(p, opts);
      -      /**
      -       * The object of the triple.
      -       * @type jQuery.rdf.resource|jQuery.rdf.blank|jQuery.rdf.literal
      -       */
      -      this.object = object(o, opts);
      -      /**
      -       * (Experimental) The named graph the triple belongs to.
      -       * @type jQuery.rdf.resource|jQuery.rdf.blank
      -       */
      -      this.graph = opts.graph === undefined ? undefined : subject(opts.graph, opts);
      -      /**
      -       * The source of the triple, which might be a node within the page (if the RDF is generated from the page) or a string holding the pattern that generated the triple.
      -       */
      -      this.source = opts.source;
      -      return this;
      -    },
      -
      -    /**
      -     * Always returns true for triples.
      -     * @see jQuery.rdf.pattern#isFixed
      -     */
      -    isFixed: function () {
      -      return true;
      -    },
      -
      -    /**
      -     * Always returns this triple.
      -     * @see jQuery.rdf.pattern#triple
      -     */
      -    triple: function (bindings) {
      -      return this;
      -    },
      -
      -    /**
      -     * Returns a <a href="http://n2.talis.com/wiki/RDF_JSON_Specification">RDF/JSON</a> representation of this triple.
      -     * @returns {Object}
      -     */
      -    dump: function () {
      -      var e = {},
      -        s = this.subject.value.toString(),
      -        p = this.property.value.toString();
      -      e[s] = {};
      -      e[s][p] = this.object.dump();
      -      return e;
      -    },
      -
      -    /**
      -     * Returns a string representing this triple in Turtle format.
      -     * @returns {String}
      -     */
      -    toString: function () {
      -      return this.subject + ' ' + this.property + ' ' + this.object + ' .';
      -    }
      -  };
      -
      -  $.rdf.triple.fn.init.prototype = $.rdf.triple.fn;
      -
      -  $.rdf.triple.defaults = {
      -    base: $.uri.base(),
      -    source: [document],
      -    namespaces: {}
      -  };
      -
      -  /**
      -   * <p>Creates a new jQuery.rdf.resource object. This should be invoked as a method rather than constructed using new; indeed you will not usually want to generate these objects directly, since they are automatically created from strings where necessary, such as by {@link jQuery.rdf#add}.</p>
      -   * @class Represents an RDF resource.
      -   * @param {String|jQuery.uri} value The value of the resource. If it's a string it must be in the format <code>&lt;<var>uri</var>&gt;</code> or <code><var>curie</var></code>.
      -   * @param {Object} [options] Initialisation of the resource.
      -   * @param {Object} [options.namespaces] An object representing a set of namespace bindings used when interpreting the CURIE specifying the resource.
      -   * @param {String|jQuery.uri} [options.base] The base URI used to interpret any relative URIs used within the URI specifying the resource.
      -   * @returns {jQuery.rdf.resource} The newly-created resource.
      -   * @throws {String} Errors if the string is not in a recognised format.
      -   * @example thisPage = $.rdf.resource('<>');
      -   * @example foaf.Person = $.rdf.resource('foaf:Person', { namespaces: ns });
      -   * @see jQuery.rdf.pattern
      -   * @see jQuery.rdf.triple
      -   * @see jQuery.rdf.blank
      -   * @see jQuery.rdf.literal
      -   */
      -  $.rdf.resource = function (value, options) {
      -    var resource;
      -    if (memResource[value]) {
      -      return memResource[value];
      -    }
      -    resource = new $.rdf.resource.fn.init(value, options);
      -    if (memResource[resource]) {
      -      return memResource[resource];
      -    } else {
      -      memResource[resource] = resource;
      -      return resource;
      -    }
      -  };
      -
      -  $.rdf.resource.fn = $.rdf.resource.prototype = {
      -    /**
      -     * Always fixed to 'uri' for resources.
      -     * @type String
      -     */
      -    type: 'uri',
      -    /**
      -     * The URI for the resource.
      -     * @type jQuery.rdf.uri
      -     */
      -    value: undefined,
      -
      -    init: function (value, options) {
      -      var m, prefix, uri, opts;
      -      if (typeof value === 'string') {
      -        m = uriRegex.exec(value);
      -        opts = $.extend({}, $.rdf.resource.defaults, options);
      -        if (m !== null) {
      -          this.value = $.uri.resolve(m[1].replace(/\\>/g, '>'), opts.base);
      -        } else if (value.substring(0, 1) === ':') {
      -          uri = opts.namespaces[''];
      -          if (uri === undefined) {
      -            throw "Malformed Resource: No namespace binding for default namespace in " + value;
      -          } else {
      -            this.value = $.uri.resolve(uri + value.substring(1));
      -          }
      -        } else if (value.substring(value.length - 1) === ':') {
      -          prefix = value.substring(0, value.length - 1);
      -          uri = opts.namespaces[prefix];
      -          if (uri === undefined) {
      -            throw "Malformed Resource: No namespace binding for prefix " + prefix + " in " + value;
      -          } else {
      -            this.value = $.uri.resolve(uri);
      -          }
      -        } else {
      -          try {
      -            this.value = $.curie(value, { namespaces: opts.namespaces });
      -          } catch (e) {
      -            throw "Malformed Resource: Bad format for resource " + e;
      -          }
      -        }
      -      } else {
      -        this.value = value;
      -      }
      -      return this;
      -    }, // end init
      -
      -    /**
      -     * Returns a <a href="http://n2.talis.com/wiki/RDF_JSON_Specification">RDF/JSON</a> representation of this triple.
      -     * @returns {Object}
      -     */
      -    dump: function () {
      -      return {
      -        type: 'uri',
      -        value: this.value.toString()
      -      };
      -    },
      -
      -    /**
      -     * Returns a string representing this resource in Turtle format.
      -     * @returns {String}
      -     */
      -    toString: function () {
      -      return '<' + this.value + '>';
      -    }
      -  };
      -
      -  $.rdf.resource.fn.init.prototype = $.rdf.resource.fn;
      -
      -  $.rdf.resource.defaults = {
      -    base: $.uri.base(),
      -    namespaces: {}
      -  };
      -
      -  /**
      -   * A {@link jQuery.rdf.resource} for rdf:type
      -   * @constant
      -   * @type jQuery.rdf.resource
      -   */
      -  $.rdf.type = $.rdf.resource('<' + rdfNs + 'type>');
      -  /**
      -   * A {@link jQuery.rdf.resource} for rdfs:label
      -   * @constant
      -   * @type jQuery.rdf.resource
      -   */
      -  $.rdf.label = $.rdf.resource('<' + rdfsNs + 'label>');
      -  /**
      -   * A {@link jQuery.rdf.resource} for rdf:first
      -   * @constant
      -   * @type jQuery.rdf.resource
      -   */
      -  $.rdf.first = $.rdf.resource('<' + rdfNs + 'first>');
      -  /**
      -   * A {@link jQuery.rdf.resource} for rdf:rest
      -   * @constant
      -   * @type jQuery.rdf.resource
      -   */
      -  $.rdf.rest = $.rdf.resource('<' + rdfNs + 'rest>');
      -  /**
      -   * A {@link jQuery.rdf.resource} for rdf:nil
      -   * @constant
      -   * @type jQuery.rdf.resource
      -   */
      -  $.rdf.nil = $.rdf.resource('<' + rdfNs + 'nil>');
      -  /**
      -   * A {@link jQuery.rdf.resource} for rdf:subject
      -   * @constant
      -   * @type jQuery.rdf.resource
      -   */
      -  $.rdf.subject = $.rdf.resource('<' + rdfNs + 'subject>');
      -  /**
      -   * A {@link jQuery.rdf.resource} for rdf:property
      -   * @constant
      -   * @type jQuery.rdf.resource
      -   */
      -  $.rdf.property = $.rdf.resource('<' + rdfNs + 'property>');
      -  /**
      -   * A {@link jQuery.rdf.resource} for rdf:object
      -   * @constant
      -   * @type jQuery.rdf.resource
      -   */
      -  $.rdf.object = $.rdf.resource('<' + rdfNs + 'object>');
      -
      -  /**
      -   * <p>Creates a new jQuery.rdf.blank object. This should be invoked as a method rather than constructed using new; indeed you will not usually want to generate these objects directly, since they are automatically created from strings where necessary, such as by {@link jQuery.rdf#add}.</p>
      -   * @class Represents an RDF blank node.
      -   * @param {String} value A representation of the blank node in the format <code>_:<var>id</var></code> or <code>[]</code> (which automatically creates a new blank node with a unique ID).
      -   * @returns {jQuery.rdf.blank} The newly-created blank node.
      -   * @throws {String} Errors if the string is not in a recognised format.
      -   * @example newBlank = $.rdf.blank('[]');
      -   * @example identifiedBlank = $.rdf.blank('_:fred');
      -   * @see jQuery.rdf.pattern
      -   * @see jQuery.rdf.triple
      -   * @see jQuery.rdf.resource
      -   * @see jQuery.rdf.literal
      -   */
      -  $.rdf.blank = function (value) {
      -    var blank;
      -    if (memBlank[value]) {
      -      return memBlank[value];
      -    }
      -    blank = new $.rdf.blank.fn.init(value);
      -    if (memBlank[blank]) {
      -      return memBlank[blank];
      -    } else {
      -      memBlank[blank] = blank;
      -      return blank;
      -    }
      -  };
      -
      -  $.rdf.blank.fn = $.rdf.blank.prototype = {
      -    /**
      -     * Always fixed to 'bnode' for blank nodes.
      -     * @type String
      -     */
      -    type: 'bnode',
      -    /**
      -     * The value of the blank node in the format <code>_:<var>id</var></code>
      -     * @type String
      -     */
      -    value: undefined,
      -    /**
      -     * The id of the blank node.
      -     * @type String
      -     */
      -    id: undefined,
      -
      -    init: function (value) {
      -      if (value === '[]') {
      -        this.id = blankNodeID();
      -        this.value = '_:' + this.id;
      -      } else if (value.substring(0, 2) === '_:') {
      -        this.id = value.substring(2);
      -        this.value = value;
      -      } else {
      -        throw "Malformed Blank Node: " + value + " is not a legal format for a blank node";
      -      }
      -      return this;
      -    },
      -
      -    /**
      -     * Returns a <a href="http://n2.talis.com/wiki/RDF_JSON_Specification">RDF/JSON</a> representation of this blank node.
      -     * @returns {Object}
      -     */
      -    dump: function () {
      -      return {
      -        type: 'bnode',
      -        value: this.value
      -      };
      -    },
      -
      -    /**
      -     * Returns the value this blank node.
      -     * @returns {String}
      -     */
      -    toString: function () {
      -      return this.value;
      -    }
      -  };
      -
      -  $.rdf.blank.fn.init.prototype = $.rdf.blank.fn;
      -
      -  /**
      -   * <p>Creates a new jQuery.rdf.literal object. This should be invoked as a method rather than constructed using new; indeed you will not usually want to generate these objects directly, since they are automatically created from strings where necessary, such as by {@link jQuery.rdf#add}.</p>
      -   * @class Represents an RDF literal.
      -   * @param {String|boolean|Number} value Either the value of the literal or a string representation of it. If the datatype or lang options are specified, the value is taken as given. Otherwise, if it's a Javascript boolean or numeric value, it is interpreted as a value with a xsd:boolean or xsd:double datatype. In all other cases it's interpreted as a literal as defined in <a href="http://www.w3.org/TeamSubmission/turtle/#literal">Turtle syntax</a>.
      -   * @param {Object} [options] Initialisation options for the literal.
      -   * @param {String} [options.datatype] The datatype for the literal. This should be a safe CURIE; in other words, it can be in the format <code><var>uri</var></code> or <code>[<var>curie</var>]</code>. Must not be specified if options.lang is also specified.
      -   * @param {String} [options.lang] The language for the literal. Must not be specified if options.datatype is also specified.
      -   * @param {Object} [options.namespaces] An object representing a set of namespace bindings used when interpreting a CURIE in the datatype.
      -   * @param {String|jQuery.uri} [options.base] The base URI used to interpret a relative URI in the datatype.
      -   * @returns {jQuery.rdf.literal} The newly-created literal.
      -   * @throws {String} Errors if the string is not in a recognised format or if both options.datatype and options.lang are specified.
      -   * @example trueLiteral = $.rdf.literal(true);
      -   * @example numericLiteral = $.rdf.literal(5);
      -   * @example dateLiteral = $.rdf.literal('"2009-07-13"^^xsd:date', { namespaces: ns });
      -   * @see jQuery.rdf.pattern
      -   * @see jQuery.rdf.triple
      -   * @see jQuery.rdf.resource
      -   * @see jQuery.rdf.blank
      -   */
      -  $.rdf.literal = function (value, options) {
      -    var literal;
      -    if (memLiteral[value]) {
      -      return memLiteral[value];
      -    }
      -    literal = new $.rdf.literal.fn.init(value, options);
      -    if (memLiteral[literal]) {
      -      return memLiteral[literal];
      -    } else {
      -      memLiteral[literal] = literal;
      -      return literal;
      -    }
      -  };
      -
      -  $.rdf.literal.fn = $.rdf.literal.prototype = {
      -    /**
      -     * Always fixed to 'literal' for literals.
      -     * @type String
      -     */
      -    type: 'literal',
      -    /**
      -     * The value of the literal as a string.
      -     * @type String
      -     */
      -    value: undefined,
      -    /**
      -     * The language of the literal, if it has one; otherwise undefined.
      -     * @type String
      -     */
      -    lang: undefined,
      -    /**
      -     * The datatype of the literal, if it has one; otherwise undefined.
      -     * @type jQuery.uri
      -     */
      -    datatype: undefined,
      -
      -    init: function (value, options) {
      -      var
      -        m, datatype,
      -        opts = $.extend({}, $.rdf.literal.defaults, options);
      -      if (opts.lang !== undefined && opts.datatype !== undefined) {
      -        throw "Malformed Literal: Cannot define both a language and a datatype for a literal (" + value + ")";
      -      }
      -      if (opts.datatype !== undefined) {
      -        datatype = $.safeCurie(opts.datatype, { namespaces: opts.namespaces });
      -        $.extend(this, $.typedValue(value.toString(), datatype));
      -      } else if (opts.lang !== undefined) {
      -        this.value = value.toString();
      -        this.lang = opts.lang;
      -      } else if (typeof value === 'boolean') {
      -        $.extend(this, $.typedValue(value.toString(), xsdNs + 'boolean'));
      -      } else if (typeof value === 'number') {
      -        $.extend(this, $.typedValue(value.toString(), xsdNs + 'double'));
      -      } else if (value === 'true' || value === 'false') {
      -        $.extend(this, $.typedValue(value, xsdNs + 'boolean'));
      -      } else if ($.typedValue.valid(value, xsdNs + 'integer')) {
      -        $.extend(this, $.typedValue(value, xsdNs + 'integer'));
      -      } else if ($.typedValue.valid(value, xsdNs + 'decimal')) {
      -        $.extend(this, $.typedValue(value, xsdNs + 'decimal'));
      -      } else if ($.typedValue.valid(value, xsdNs + 'double') &&
      -                 !/^\s*([\-\+]?INF|NaN)\s*$/.test(value)) {  // INF, -INF and NaN aren't valid literals in Turtle
      -        $.extend(this, $.typedValue(value, xsdNs + 'double'));
      -      } else {
      -        m = literalRegex.exec(value);
      -        if (m !== null) {
      -          this.value = (m[2] || m[4]).replace(/\\"/g, '"');
      -          if (m[9]) {
      -            datatype = $.rdf.resource(m[9], opts);
      -            $.extend(this, $.typedValue(this.value, datatype.value));
      -          } else if (m[7]) {
      -            this.lang = m[7];
      -          }
      -        } else {
      -          throw "Malformed Literal: Couldn't recognise the value " + value;
      -        }
      -      }
      -      return this;
      -    }, // end init
      -
      -    /**
      -     * Returns a <a href="http://n2.talis.com/wiki/RDF_JSON_Specification">RDF/JSON</a> representation of this blank node.
      -     * @returns {Object}
      -     */
      -    dump: function () {
      -      var e = {
      -        type: 'literal',
      -        value: this.value.toString()
      -      };
      -      if (this.lang !== undefined) {
      -        e.lang = this.lang;
      -      } else if (this.datatype !== undefined) {
      -        e.datatype = this.datatype.toString();
      -      }
      -      return e;
      -    },
      -    
      -    /**
      -     * Returns a string representing this resource in <a href="http://www.w3.org/TeamSubmission/turtle/#literal">Turtle format</a>.
      -     * @returns {String}
      -     */
      -    toString: function () {
      -      var val = '"' + this.value + '"';
      -      if (this.lang !== undefined) {
      -        val += '@' + this.lang;
      -      } else if (this.datatype !== undefined) {
      -        val += '^^<' + this.datatype + '>';
      -      }
      -      return val;
      -    }
      -  };
      -
      -  $.rdf.literal.fn.init.prototype = $.rdf.literal.fn;
      -
      -  $.rdf.literal.defaults = {
      -    base: $.uri.base(),
      -    namespaces: {},
      -    datatype: undefined,
      -    lang: undefined
      -  };
      -
      -})(jQuery);
      Index: src/main/resources/META-INF/static/images/fise_logo_cropped.png
      ===================================================================
      Cannot display: file marked as a binary type.
      svn:mime-type = application/octet-stream
      Index: src/main/resources/META-INF/static/images/add.gif
      ===================================================================
      Cannot display: file marked as a binary type.
      svn:mime-type = application/octet-stream
      Index: src/main/resources/META-INF/static/images/black_gear_16.png
      ===================================================================
      Cannot display: file marked as a binary type.
      svn:mime-type = application/octet-stream
      Index: src/main/resources/META-INF/static/images/stlabLogo.jpg
      ===================================================================
      Cannot display: file marked as a binary type.
      svn:mime-type = application/octet-stream
      Index: src/main/resources/META-INF/static/scripts/scout.js
      ===================================================================
      --- src/main/resources/META-INF/static/scripts/scout.js	(revision 1148250)
      +++ src/main/resources/META-INF/static/scripts/scout.js	(working copy)
      @@ -1,694 +0,0 @@
      -$(document).ready(function() {
      -	_ = {};
      -	_.labels = [];
      -	_.labels['http://www.cnr.it/ontology/cnr/istituti.owl#unitÌÄ OrganizzativaDiSupporto'] = 'UnitÌÄ  Organizzativa di supporto';
      -	_.labels['http://www.w3.org/2004/02/skos/core#subject'] = 'Subject';
      -	_.labels['http://localhost/cnr/categorie.owl#CategoriaDBpedia'] = 'Categoria DBpedia';
      -	_.labels['$default$'] = 'Altro';
      -	_.labels.get = function(uri) {
      -		if(!uri) return 'Label N/A';
      -		if(this[uri]) return this[uri].replace(/^./,function($0){return $0.toUpperCase()});
      -		else return uri.replace(/.+#([\w\d]+)$/,'$1').replace(/([A-Z])/g,' $1').replace(/^./,function($0){return $0.toUpperCase()});
      -	}
      -	_.rootId = 'http://www.cnr.it/ontology/cnr/individuo/unitaDiPersonaleInterno/MATRICOLA1582';
      -	_.rootId = window.rootId ? window.rootId : _.rootId;
      -	_.nodes = new Array();
      -	_.addNode = function(node){
      -		_.nodes[node.uri] = node;
      -	};
      -
      -	_.nodeColors = {
      -		'http://www.cnr.it/ontology/cnr/categorie.owl#AreaDisciplinare' : '#90538A',
      -		'http://www.cnr.it/ontology/cnr/categorie.owl#AreaDiValutazione' : '#90538A',
      -		'http://www.cnr.it/ontology/cnr/categorie.owl#CategoriaDBpedia' : '#90538A',
      -		'http://localhost/cnr/categorie.owl#CategoriaDBpedia' : '#90538A',
      -		'http://www.cnr.it/ontology/cnr/categorie.owl#DisciplinaDiRiferimento' : '#90538A',
      -
      -		'http://www.cnr.it/ontology/cnr/descrizionecommessa.owl#DescrizioneCollaborazioni' : '#FFFE12',
      -		'http://www.cnr.it/ontology/cnr/descrizionecommessa.owl#DescrizioneCommessa' : '#FFFE12',
      -		'http://www.cnr.it/ontology/cnr/descrizionecommessa.owl#DescrizioneStatoAvanzamentoAttivita' : '#FFFE12',
      -		'http://www.cnr.it/ontology/cnr/descrizionecommessa.owl#PrevisioneAttivita' : '#FFFE12',
      -		'http://www.cnr.it/ontology/cnr/descrizionedipartimento.owl#DescrizioneAttivita' : '#FFFE12',
      -		'http://www.cnr.it/ontology/cnr/descrizionedipartimento.owl#DescrizioneContesto' : '#FFFE12',
      -		'http://www.cnr.it/ontology/cnr/descrizionedipartimento.owl#DescrizioneDipartimento' : '#FFFE12',
      -		'http://www.cnr.it/ontology/cnr/descrizionedipartimento.owl#DescrizioneSettoreDiIntervento' : '#FFFE12',
      -		'http://www.cnr.it/ontology/cnr/descrizionemodulo.owl#DescrizioneModulo' : '#FFFE12',
      -		'http://www.cnr.it/ontology/cnr/descrizioneprogetto.owl#DescrizioneAttivita' : '#FFFE12',
      -		'http://www.cnr.it/ontology/cnr/descrizioneprogetto.owl#DescrizioneContesto' : '#FFFE12',
      -		'http://www.cnr.it/ontology/cnr/descrizioneprogetto.owl#DescrizioneObiettivi' : '#FFFE12',
      -		'http://www.cnr.it/ontology/cnr/descrizioni.owl#Descrizione' : '#FFFE12',
      -		'http://www.cnr.it/ontology/cnr/brevetti.owl#AreaTecnologica' : '#FFFE12',
      -
      -		'http://www.cnr.it/ontology/cnr/istituti.owl#Direttore' : '#DE175A',
      -		'http://www.cnr.it/ontology/cnr/personale.owl#TipoDiRapporto' : '#DE175A',
      -		'http://www.cnr.it/ontology/cnr/personale.owl#UnitaDiPersonaleEsterno' : '#DE175A',
      -		'http://www.cnr.it/ontology/cnr/personale.owl#UnitaDiPersonaleInterno' : '#DE175A',
      -		'http://www.cnr.it/ontology/cnr/persone.owl#Persona' : '#DE175A',
      -
      -		'http://www.cnr.it/ontology/cnr/personale.owl#PartecipazioneACommessa' : '#59E18F',
      -		'http://www.cnr.it/ontology/cnr/personale.owl#RapportoConCNR' : '#59E18F',
      -
      -
      -		'http://www.cnr.it/ontology/cnr/prodottidellaricerca.owl#RisultatoApplicativo' : '#008BDB',
      -		'http://www.cnr.it/ontology/cnr/prodottidellaricerca.owl#RisultatoProgettuale' : '#008BDB',
      -		'http://www.cnr.it/ontology/cnr/pubblicazioni.owl#Abstract' : '#008BDB',
      -		'http://www.cnr.it/ontology/cnr/pubblicazioni.owl#ArticoloConvegno' : '#008BDB',
      -		'http://www.cnr.it/ontology/cnr/pubblicazioni.owl#ArticoloISI' : '#008BDB',
      -		'http://www.cnr.it/ontology/cnr/pubblicazioni.owl#ArticoloNonISI' : '#008BDB',
      -		'http://www.cnr.it/ontology/cnr/pubblicazioni.owl#AttivitaEditoriale' : '#008BDB',
      -		'http://www.cnr.it/ontology/cnr/pubblicazioni.owl#Libro' : '#008BDB',
      -		'http://www.cnr.it/ontology/cnr/pubblicazioni.owl#Rapporto' : '#008BDB',
      -		'http://www.cnr.it/ontology/cnr/pubblicazioni.owl#Rivista' : '#008BDB',
      -		'http://www.cnr.it/ontology/cnr/pubblicazioni.owl#Tipologia' : '#008BDB',
      -		'http://www.cnr.it/ontology/cnr/brevetti.owl#Brevetto' : '#008BDB',
      -
      -		'http://www.cnr.it/ontology/cnr/persone.owl#Organizzazione' : '#FFAE04',
      -		'http://www.cnr.it/ontology/cnr/istituti.owl#UnitaOrganizzativa' : '#FFAE04',
      -		'http://www.cnr.it/ontology/cnr/retescientifica.owl#Commessa' : '#FFAE04',
      -		'http://www.cnr.it/ontology/cnr/retescientifica.owl#Dipartimento' : '#FFAE04',
      -		'http://www.cnr.it/ontology/cnr/retescientifica.owl#Istituto' : '#FFAE04',
      -		'http://www.cnr.it/ontology/cnr/retescientifica.owl#Modulo' : '#FFAE04',
      -		'http://www.cnr.it/ontology/cnr/retescientifica.owl#Progetto' : '#FFAE04',
      -		'http://www.cnr.it/ontology/cnr/strutturacnr.owl#StrutturaGestionale' : '#FFAE04',
      -
      -		'$default$':'#FFF'
      -	}
      -
      -
      -
      -	_.nodeColors_old = {
      -		'http://www.cnr.it/ontology/cnr/personale.owl#UnitaDiPersonaleInterno' : '#CA5794',
      -		'http://www.cnr.it/ontology/cnr/personale.owl#UnitaDiPersonaleEsterno' : '#CA5794',
      -		'http://www.cnr.it/ontology/cnr/pubblicazioni.owl#ArticoloConvegno' : '#D0E332',
      -		'http://www.cnr.it/ontology/cnr/pubblicazioni.owl#Libro' : '#D0E332',
      -		'http://www.cnr.it/ontology/cnr/pubblicazioni.owl#ArticoloNonISI' : '#D0E332',
      -		'http://www.cnr.it/ontology/cnr/pubblicazioni.owl#ArticoloISI' : '#D0E332',
      -		'http://www.cnr.it/ontology/cnr/pubblicazioni.owl#AttivitaEditoriale' : '#D0E332',
      -		'http://www.cnr.it/ontology/cnr/retescientifica.owl#Istituto' : '#D8C090',
      -		'http://www.cnr.it/ontology/cnr/istituti.owl#UnitaOrganizzativa' : '#D8C090',
      -		'http://www.cnr.it/ontology/cnr/retescientifica.owl#Commessa' : '#B06A12',
      -		'http://www.cnr.it/ontology/cnr/personale.owl#RapportoConCNR' : '#E2B365',
      -		'http://www.cnr.it/ontology/cnr/personale.owl#PartecipazioneACommessa' : '#5796E6',
      -		'http://www.cnr.it/ontology/cnr/categorie.owl#CategoriaDBpedia' : '#EDCE35',
      -		'http://localhost/cnr/categorie.owl#CategoriaDBpedia' : '#EDCE35',
      -		'$default$':'lime'
      -	}
      -	_.H = {
      -		i : 0,
      -		items : [],
      -		push : function(item) {
      -			this.items.splice(this.items.length-this.i,this.i,item);
      -			this.i = 0;
      -			this.setbuttons();
      -		},
      -		go : function(delta){
      -			if(!this.test(delta)) return null;
      -			delta = -1*delta;
      -			this.i += delta;
      -			this.setbuttons();
      -			_.displayData(_.nodes[this.items[this.items.length-this.i-1]]);
      -			return this.items[this.items.length-this.i-1];
      -		},
      -		get : function(delta){
      -			if(!this.test(delta)) return null;
      -			delta = -1*delta;
      -			return this.items[this.items.length - this.i + delta - 1];
      -		},
      -		test : function (delta) {
      -			delta = -1*delta;
      -			if((this.i + delta)>=this.items.length || (this.i + delta<0)) return false;
      -			return true
      -		},
      -		setbuttons : function(){
      -			if(this.test(+1)) _.forwButton.button('enable');
      -			else _.forwButton.button('disable');
      -			if(this.test(-1)) _.backButton.button('enable');
      -			else _.backButton.button('disable');
      -		},
      -		clear : function(){
      -			this.i = 0;
      -			this.items = [];
      -			this.setbuttons();
      -		}
      -	}
      -
      -
      -	function init(){
      -		//init RGraph
      -		_.graph = new $jit.Hypertree({
      -		//_.graph = new $jit.RGraph({
      -			//Where to append the visualization
      -			injectInto: 'infovis',
      -			//Optional: create a background canvas that plots
      -			//concentric circles.
      -			/*
      -			background: {
      -				CanvasStyles: {
      -					strokeStyle: '#555'
      -				}
      -			},
      -			*/
      -			//Add navigation capabilities:
      -			//zooming by scrolling and panning.
      -			Navigation: {
      -				enable: true,
      -				panning: 'avoid nodes',
      -				zooming: 100,
      -//				type: 'auto'
      -			},
      -			transition: $jit.Trans.Quad.easeOut,
      -			duration: 500,
      -			fps: 60,
      -			Node: {
      -				dim: 4,
      -				color: _.nodeColors['$default$'],
      -				transform:false,
      -				overridable:true
      -			},
      -			Edge: {
      -				lineWidth: 1,
      -				color: _.nodeColors['$default$'],
      -				alpha : 1,
      -				overridable:true
      -			},
      -
      -			onCreateLabel: function(domElement, node){
      -				$(domElement).html('<span class="short">'+node.name.substring(0,20)+((node.name).length>20 ? ' ...' : '')+'</span><span class="full">'+node.name+'</span>');
      -				$(domElement).attr('title',node.name+' [type: '+_.labels.get(node.data['http://www.w3.org/1999/02/22-rdf-syntax-ns#type'][0]['value'])+' | id: '+node.id+']');
      -//				$(domElement).css('color',_.nodeColors[node.data['http://www.w3.org/1999/02/22-rdf-syntax-ns#type'][0]['value']] || _.nodeColors['$default$']);
      -//				domElement.onclick = function(){  
      -//					_.graph.onClick(node.id);
      -//				};
      -				$(domElement).click(function(){
      -					if(node.id == _.H.get(0)) return;
      -//					$('#loader').fadeTo('slow', 0.8);
      -					_.graph.onClick(node.id);
      -					_.H.push(node.id);
      -					_.displayData(_.nodes[node.id]);
      -//					$('#loader').fadeOut();
      -				});
      -//				$(domElement).click(function(){alert('!')
      -//					if(node.id == _.H.get(0)) {
      -//						_.displayData(_.nodes[node.id]);
      -//						return;
      -//					}
      -//					_.H.push(node.id);
      -//					if(!_.nodes[node.id]) {
      -//						_.sum(node.id);
      -//					} else {
      -//						_.graph.onClick(node.id);
      -//					}
      -//					_.displayData(_.nodes[node.id]);
      -//				});
      -				$(domElement).mouseover(function(){
      -					$(domElement).addClass('nodeOver');
      -				});
      -				$(domElement).mouseout(function(){
      -					$(domElement).removeClass('nodeOver');
      -				});
      -			},
      -			onPlaceLabel: function(domElement, node){
      -				$(domElement).css({
      -					'display':'block',
      -					'cursor':'pointer'
      -				});
      -				$(domElement).attr('class','node dept-'+(node._depth < 3 ? node._depth : 'deep'));
      -				var style = domElement.style; 
      -				var left = parseInt(style.left);
      -				var w = domElement.offsetWidth;
      -				style.left = (left - w / 2) + 'px';
      -			},
      -			onBeforePlotNode:function(node){
      -				node.data['$color'] = _.nodeColors[node.data['http://www.w3.org/1999/02/22-rdf-syntax-ns#type'][0]['value']] || _.nodeColors['$default$'];
      -				node.data['$dim'] = node._depth == 0 ? 6 : (4-node._depth)>=0 ? 4-node._depth : 0
      -			},
      -			onBeforePlotLine:function(adj){
      -				adj.data['$color'] = _.nodeColors[adj.nodeTo.data['http://www.w3.org/1999/02/22-rdf-syntax-ns#type'][0]['value']] || _.nodeColors['$default$'];
      -			},
      -
      -		});
      -	}
      -	/**
      -	 * Function initInterface()
      -	 */
      -	_.initInterface = function(){
      -		_.infovis = $('#infovis');
      -		_.w = _.infovis.width() - 400;
      -		_.h = _.infovis.height()-10;
      -		_.r = _.w<_.h ? _.w/2 : _.h/2;
      -	}
      -
      -	_.onRelClick = function(o){
      -		o = document.getElementById(o);
      -		$(o).click();
      -	}
      -	_.onRelOver = function(o){
      -		o = document.getElementById(o);
      -		$(o).mouseover();
      -	}
      -	_.onRelOut = function(o){
      -		o = document.getElementById(o);
      -		$(o).mouseout();
      -	}
      -
      -	_.sum = function(uri){
      -		$.getJSON('json.php?url='+uri,function(data){
      -			_.parseCurrentJSONData(uri,data);
      -			_.graph.op.sum(_.makeJSONTree(_.nodes[uri]),{
      -				type: 'fade:con',
      -				duration: 500,
      -				onComplete:function(){
      -				//					_.displayData(_.nodes[_.H.get(0)]);
      -				}
      -			});
      -		});
      -	}
      -	/*
      -	 * function setDataBoxLabel(node)
      -	 */
      -	_.setDataBoxLabel = function(node){
      -		$('#currentnodelabel').html(node.getLabel());
      -	}
      -	/*
      -	 * function setDataBoxMetatadataTab(node)
      -	 */
      -	_.setDataBoxMetatadataTab = function(node){
      -		//		var metadataboxDL = $('<dl/>').appendTo($('#metadatabox'));
      -		//		$.each(node.getMetadatas(),function(k,v){
      -		//			$('<dt/>').html(k).appendTo(metadataboxDL);
      -		//			$.each(v,function(kk,vv){
      -		//				$(metadataboxDL).append($('<dd/>').html(vv));
      -		//			})
      -		//		});
      -		$('#metadatabox').html('');
      -		$.each(node.getMetadatas(),function(k,v){
      -			$.each(v,function(kk,vv){
      -				$('#metadatabox').append('<div><strong>'+vv.label+'</strong>: '+vv.value+'</div>');
      -			})
      -		});
      -	}
      -
      -	/*
      -	 * function setDataBoxRelationsTab(node)
      -	 */
      -	_.setDataBoxRelationsTab = function(node){
      -		$('#relationsbox').html('');
      -		var ul = $('<ul></ul>');
      -		$.each(node.getRelations(),function(k,v){
      -			var li = $('<li></li>');
      -			var toggler = $('<span class="toggler"/>').click(function(){
      -				$('ul',this.parentNode).slideToggle();
      -			}).css({
      -				'cursor' : 'pointer'
      -			}).appendTo(li);
      -			var massdownloader = $('<span class="massdowloader"/>').click(function(){
      -				$('[title="Download node"]',this.parentNode).click();
      -			}).css({
      -				'cursor' : 'pointer'
      -			}).appendTo(li);
      -			$('<span/>').css({
      -				'float': 'left',
      -				'margin-right': '0.3em'
      -			}).attr('class','opencloseButt ui-icon ui-icon-triangle-2-n-s').appendTo(toggler);
      -			$('<span/>').css({
      -				'float': 'left',
      -				'margin-right': '0.3em'
      -			}).attr('class','opencloseButt ui-icon ui-icon-arrowthickstop-1-s').appendTo(massdownloader);
      -			$('<span>'+_.labels.get(k)+' ('+v.size+')'+'</span>').appendTo(li);
      -			var subul = $('<ul class="subul"></ul>').appendTo(li);
      -//			$.each(v,function(kk,vv){
      -			for(kk in v) {
      -				var vv = v[kk];
      -				var currid = vv['uri'];
      -				var hasNode = _.graph.graph.getNode(currid) && true;
      -				var spanLabel = $('<span/>').html(vv['value']);
      -				var goButt = $('<span/>');
      -				goButt.css({
      -					'float': 'left',
      -					'margin-right': '0.3em',
      -					'cursor' : 'pointer'
      -				}).attr('class','ui-icon ' + (hasNode ? 'ui-icon-circle-triangle-e' : 'ui-icon-arrowthickstop-1-s')).click(function(){
      -					var targetId = $(this).parent().attr('id').replace(/^rel:\/\//,'');
      -					var hasNode = _.graph.graph.getNode(targetId);
      -					if(hasNode) _.onRelClick($(this).parent().attr('id').replace(/^rel:\/\//,''));
      -					else{
      -						//						_.H.push(targetId);
      -						_.sum(targetId);
      -					}
      -					$(this).removeClass('ui-icon-arrowthickstop-1-s').addClass('ui-icon-circle-triangle-e');
      -				}).attr('title',hasNode ? 'Show node' : 'Download node').html('&nbsp;');
      -				var infoButt = $('<span/>').css({
      -					'float': 'left',
      -					'margin-right': '0.3em',
      -					'cursor' : 'pointer'
      -				}).attr('class','ui-icon ui-icon-info').click(function(){
      -					var targetId = $(this).parent().attr('id').replace(/^rel:\/\//,'');
      -					var winTitle = $(this).parent().attr('title');
      -					_.scheda(targetId,winTitle);
      -				}).attr('title','More info').html('&nbsp;');
      -				var cartButt = $('<span/>').css({
      -					'float': 'left',
      -					'margin-right': '0.3em',
      -					'cursor' : 'pointer'
      -				}).attr('class','ui-icon ui-icon-cart').click(function(){
      -					var nodeToAdd = {
      -						id : $(this).parent().attr('id').replace(/^rel:\/\//,''),
      -						name : $(this).parent().attr('title')
      -					}
      -					_.basket.add(nodeToAdd);
      -					$(this).fadeOut(300).fadeIn(300);
      -				}).attr('title','Aggiungi al carrello').html('&nbsp;');
      -				var subli = $('<li/>').append(infoButt,goButt,cartButt,spanLabel).mouseover(function(){
      -					_.onRelOver((this.id).replace(/^rel:\/\//,''));
      -				}).mouseout(function(){
      -					_.onRelOut((this.id).replace(/^rel:\/\//,''));
      -				}).attr('id','rel://'+currid).attr('title',vv['value']);
      -				$(subul).append(subli);
      -			}
      -			$(ul).append(li);
      -		});
      -		$('#relationsbox').append(ul);
      -		//$('.subul').toggle(false);
      -	}
      -	_.displayData = function(node){
      -		_.setDataBoxLabel(node);
      -		_.setDataBoxMetatadataTab(node);
      -		_.setDataBoxRelationsTab(node);
      -	}
      -	_.makeJSONTree = function(node){
      -		var json = {
      -			'id' : node.getUri(),
      -			'name' : node.getLabel(),
      -			'data' : _.nodes[node.getUri()].data,//_.currentJSONData[node.getUri()],
      -			'children' : []
      -		};
      -		$.each(node.getRelations(),function(k,v){
      -			$.each(v,function(kk,vv){
      -				if(_.nodes[vv['uri']]) json.children.push({
      -					'id' : vv['uri'],
      -					'name' : vv['value'],
      -					'data' : _.currentJSONData[vv['uri']],
      -					'children' : []
      -				});
      -			})
      -		});
      -		return json;
      -	}
      -	_.basket = {
      -		items : {},
      -		add : function(node){
      -			if(!node) {
      -				var currentNodeId = _.H.get(0);
      -				node = _.graph.graph.getNode(currentNodeId);
      -			}
      -			if(this.items[node.id]) return;
      -			var div = $('<div></div>').appendTo('#basketitems');
      -			var spanLabel = $('<span/>').html(node.name)
      -			var buttonGo = $('<span/>').css({
      -				'float': 'left',
      -				'margin-right': '0.3em',
      -				'cursor' : 'pointer'
      -			}).attr('class','ui-icon ui-icon-circle-triangle-e').click(function(){
      -				var targetId = node.id;
      -				var hasNode = _.graph.graph.getNode(targetId);
      -				if(hasNode) _.onRelClick(targetId);
      -				else{
      -					_.H.push(targetId);
      -					_.sum(targetId);
      -				}
      -			/*
      -				_.H.push(node.id);
      -				if(in_array(rdfinfo.loaded,node.id)) _.graph.onClick(node.id);
      -				else _.sum(node.id);
      -*/
      -			}).attr('title',node.name);
      -			var buttonDel = $('<span/>').css({
      -				'float': 'left',
      -				'margin-right': '0.3em',
      -				'cursor' : 'pointer'
      -			}).attr('class','ui-icon ui-icon-trash').click(function(){
      -				delete(_.basket.items[node.id]);
      -				_.basketExportButton.button('disable');
      -				for(var k in _.basket.items) _.basketExportButton.button('enable');
      -				$(div).remove();
      -			}).attr('title','Remove');
      -			$(div).append(buttonGo,buttonDel,spanLabel);
      -			this.items[node.id] = node.name;
      -			_.basketExportButton.button('enable');
      -		}
      -	};
      -	_.scheda = function(uri,title){
      -		$('<div></div>').css({
      -			'text-align':'left',
      -			'font-size':'80%'
      -		}).attr('title',title).load('scheda.plain.php?url='+uri+' #scheda dl').dialog({
      -			width:500,
      -			height:document.getElementById('infovis').offsetHeight/2,
      -			position:['center',document.getElementById('infovis').offsetHeight/10]
      -		})
      -	}
      -	_.Node = function(uri){
      -		var _ = this;
      -		this.id = uri;
      -		this.uri = uri;
      -		this.label = '';
      -		this.name = '';
      -		this.data = {};
      -		this.metadatas = {};
      -		this.relations = {};
      -		this.setLabel = function(string) {
      -			_.name = _.label = string;
      -		}
      -		this.addMetaData = function(meta){
      -			if(!this.metadatas[meta.id]) this.metadatas[meta.id] = new Array();
      -			this.metadatas[meta.id].push({
      -				'id' : meta.id,
      -				'label' : meta.label,
      -				'value' : meta.value
      -			});
      -		}
      -		this.addRelation = function(rel){
      -			if(!this.relations[rel.id]) this.relations[rel.id] = {size:0};
      -			if(!this.relations[rel.id][rel.uri]) this.relations[rel.id].size++;
      -			this.relations[rel.id][rel.uri] = {
      -				id : rel.id,
      -				uri : rel.uri,
      -				types : rel.types,
      -				value : rel.value,
      -				label : rel.label
      -			}
      -		}
      -		this.getUri = function(){
      -			return this.uri
      -		};
      -		this.getLabel = function(){
      -			return this.label
      -		};
      -		this.getMetadatas = function(){
      -			return this.metadatas
      -		};
      -		this.getRelations = function(){
      -			return this.relations
      -		};
      -		if(this.data['http://www.w3.org/1999/02/22-rdf-syntax-ns#type']==undefined) this.data['http://www.w3.org/1999/02/22-rdf-syntax-ns#type'] = [{value:null}];
      -		return this;
      -	}	
      -	_.parseCurrentJSONData = function(rootId,data){
      -		_.currentJSONData = data;
      -		node = new _.Node(rootId);
      -		for(var i in data[rootId]) {
      -			node.data[i] = data[rootId][i];
      -			for(var j in data[rootId][i]) {
      -				if(data[rootId][i][j]['type']=='literal') {
      -					node.addMetaData({
      -						'id' : i,
      -						'label' : _.labels.get(i),
      -						'value' : data[rootId][i][j]['value']
      -					});
      -				}
      -				else{
      -					if(data[data[rootId][i][j]['value']])
      -						for(var k in data[data[rootId][i][j]['value']]['http://www.w3.org/2000/01/rdf-schema#label']){
      -							if(i == 'http://www.w3.org/1999/02/22-rdf-syntax-ns#type'){
      -								node.addMetaData({
      -									'id' : i,
      -									'label' : _.labels.get(i),
      -									'value' : data[data[rootId][i][j]['value']]['http://www.w3.org/2000/01/rdf-schema#label'][k]['value']
      -								});
      -							} else {
      -								var types = new Array();
      -								for(var n in _.currentJSONData[data[rootId][i][j]['value']]['http://www.w3.org/1999/02/22-rdf-syntax-ns#type']) {
      -									types.push({
      -										'type' : _.currentJSONData[data[rootId][i][j]['value']]['http://www.w3.org/1999/02/22-rdf-syntax-ns#type'][n]['value'],
      -										'value' : _.labels.get(_.currentJSONData[data[rootId][i][j]['value']]['http://www.w3.org/1999/02/22-rdf-syntax-ns#type'][n]['value'])
      -									});
      -								}
      -								node.addRelation({
      -									'id' : i,
      -									'label' : _.labels.get(i),
      -									'uri' : data[rootId][i][j]['value'],
      -									'types': types,
      -									'value' : data[data[rootId][i][j]['value']]['http://www.w3.org/2000/01/rdf-schema#label'][k]['value']
      -								})
      -							}
      -						}
      -				}
      -			}
      -		}
      -		node.addMetaData({
      -			id : 'uri',
      -			label : 'uri',
      -			value : rootId
      -		})
      -		if(node.metadatas && node.metadatas['http://www.w3.org/2000/01/rdf-schema#label'] && node.metadatas['http://www.w3.org/2000/01/rdf-schema#label'][0] &&  node.metadatas['http://www.w3.org/2000/01/rdf-schema#label'][0]['value'])
      -			node.setLabel(node.metadatas['http://www.w3.org/2000/01/rdf-schema#label'][0]['value']);
      -		else
      -			node.setLabel('Label N/A');
      -		_.addNode(node);
      -	//_.displayData(node);
      -	}	
      -	_.kickStart = function(){
      -		var rootId = _.rootId;
      -		$.getJSON('ontolabels.php',function(triples){
      -			for(i in triples) {
      -				_.labels[i] = triples[i]["http://www.w3.org/2000/01/rdf-schema#label"][0].value;
      -			}
      -			$.getJSON('json.php?url='+rootId,function(data){
      -				_.parseCurrentJSONData(rootId,data);
      -				_.graph.loadJSON(_.makeJSONTree(_.nodes[rootId]));
      -				_.graph.refresh();
      -				_.H.push(rootId);
      -				_.graph.onClick(rootId);
      -				_.displayData(_.nodes[rootId]);
      -			});
      -			for (i in _.nodeColors) {
      -				$('<div>').css('color',_.nodeColors[i]).html('<span>&#x2022;</span> '+_.labels[i]).appendTo($('#legenda'));
      -			}
      -		});
      -	}
      -	_.applyInterface = function(){
      -		_.infoButton = $('<button/>').button({
      -			label:'Info',
      -			text:true,
      -			icons:{
      -				primary:'ui-icon-info'
      -			}
      -		}).click(function(){
      -			var targetNode = _.nodes[_.H.get(0)];
      -			_.scheda(targetNode.uri,targetNode.label);
      -		});
      -		_.homeButton = $('<button/>').button({
      -			label:'Nodo iniziale',
      -			text:true,
      -			icons:{
      -				primary:'ui-icon-flag'
      -			}
      -		}).click(function(){
      -			if(_.H.get(0)==_.rootId) return;
      -			$(_.backButton).button('enable');
      -			_.H.push(_.rootId);
      -			_.graph.onClick(_.rootId);
      -		});
      -		_.backButton = $('<button/>').button({
      -			label:'Back',
      -			text:true,
      -			icons:{
      -				primary:'ui-icon-carat-1-w'
      -			}
      -		}).click(function(){
      -			var curr = _.H.go(-1);
      -			_.graph.onClick(curr);
      -		});
      -		_.forwButton = $('<button/>').button({
      -			label:'Forward',
      -			text:true,
      -			icons:{
      -				primary:'ui-icon-carat-1-e'
      -			}
      -		}).click(function(){
      -			var curr = _.H.go(1);
      -			_.graph.onClick(curr);
      -		});
      -		_.detailsButton = $('<button/>').button({
      -			label:'Schede',
      -			text:true,
      -			icons:{
      -				primary:'ui-icon-carat-2-n-s'
      -			}
      -		}).click(function(){
      -			$('#databox').slideToggle();
      -		});
      -		_.legendButton = $('<button/>').button({
      -			label:'Legenda',
      -			text:true,
      -			icons:{
      -				primary:'ui-icon-carat-2-n-s'
      -			}
      -		}).click(function(){
      -			$('#legenda').slideToggle();
      -		});
      -
      -
      -
      -		_.basketButton = $('<button/>').button({
      -			label:'Aggiungi',
      -			text:true,
      -			icons:{
      -				primary:'ui-icon-cart'
      -			}
      -		}).click(function(){
      -			var currentNodeId = _.H.get(0);
      -			//			var node = _.graph.graph.getNode(currentNodeId);
      -			var node = _.nodes[currentNodeId];
      -			_.basket.add(node);
      -			$(this).fadeOut(300).fadeIn(300);
      -		});
      -		_.basketExportButton = $('<button/>').button({
      -			label:'Esporta il carrello',
      -			disabled:true,
      -			icons:{
      -				primary:'ui-icon-arrowreturnthick-1-s'
      -			}
      -		}).click(function(){
      -			uriList = new Array();
      -			for(var item in _.basket.items) uriList.push(item);
      -			uriList = uriList.join(',');
      -			window.open('basketexp.php?u='+uriList);
      -		}).appendTo('#basketui');
      -		$('body').append($('<div></div>').append(_.basketButton,_.infoButton,/*_.refreshButton,*/_.homeButton,_.backButton,_.forwButton,_.legendButton,_.detailsButton).attr('id','ui'));
      -		$('body').append($('<div></div>').attr('id','loader'));
      -		$('#databox').css({
      -			//			'width' : $('#infovis').innerWidth() - 2*_.r - 60,
      -			'width':'400px',
      -			'height':(_.h-50)+'px'
      -		});
      -		$('#metadatabox').css({
      -			'height':(_.h-160)+'px'
      -		});
      -		$('#relationsbox').css({
      -			'height':(_.h-160)+'px'
      -		});
      -		$("#databox-tabs").tabs();
      -		//		$('#currentnodelabel').click(function(){$("#databox-tabs").slideToggle()});
      -		$('#loader').ajaxSend(function(){
      -			$(this).fadeTo('slow', 0.8);
      -		});
      -		$('#loader').ajaxStop(function(){
      -			$(this).fadeOut();
      -		});
      -		$('#loader').ajaxError(function(){
      -			$(this).fadeOut();
      -			alert('Data loading error!');
      -		});
      -		$(window).error(function(){
      -			$('#loader').fadeOut();
      -			return true;
      -		});
      -	}
      -	
      -	
      -	_.initInterface();
      -	_.applyInterface();
      -	_.kickStart();
      -	init()
      -});
      Index: src/main/resources/META-INF/static/images/external.png
      ===================================================================
      Cannot display: file marked as a binary type.
      svn:mime-type = application/octet-stream
      Index: src/main/resources/META-INF/static/images/black_gear_128.png
      ===================================================================
      Cannot display: file marked as a binary type.
      svn:mime-type = application/octet-stream
      Index: src/main/resources/META-INF/static/images/next.png
      ===================================================================
      Cannot display: file marked as a binary type.
      svn:mime-type = application/octet-stream
      Index: src/main/resources/META-INF/static/images/sw-cube.png
      ===================================================================
      Cannot display: file marked as a binary type.
      svn:mime-type = application/octet-stream
      Index: src/main/resources/META-INF/static/images/rdf_flyer.64.png
      ===================================================================
      Cannot display: file marked as a binary type.
      svn:mime-type = application/octet-stream
      Index: src/main/resources/META-INF/static/images/ajax-loader.gif
      ===================================================================
      Cannot display: file marked as a binary type.
      svn:mime-type = application/octet-stream
      Index: src/main/resources/META-INF/static/scripts/jquery-1.4.2.js
      ===================================================================
      --- src/main/resources/META-INF/static/scripts/jquery-1.4.2.js	(revision 1148250)
      +++ src/main/resources/META-INF/static/scripts/jquery-1.4.2.js	(working copy)
      @@ -1,6240 +0,0 @@
      -/*!
      - * jQuery JavaScript Library v1.4.2
      - * http://jquery.com/
      - *
      - * Copyright 2010, John Resig
      - * Dual licensed under the MIT or GPL Version 2 licenses.
      - * http://jquery.org/license
      - *
      - * Includes Sizzle.js
      - * http://sizzlejs.com/
      - * Copyright 2010, The Dojo Foundation
      - * Released under the MIT, BSD, and GPL Licenses.
      - *
      - * Date: Sat Feb 13 22:33:48 2010 -0500
      - */
      -(function( window, undefined ) {
      -
      -// Define a local copy of jQuery
      -var jQuery = function( selector, context ) {
      -		// The jQuery object is actually just the init constructor 'enhanced'
      -		return new jQuery.fn.init( selector, context );
      -	},
      -
      -	// Map over jQuery in case of overwrite
      -	_jQuery = window.jQuery,
      -
      -	// Map over the $ in case of overwrite
      -	_$ = window.$,
      -
      -	// Use the correct document accordingly with window argument (sandbox)
      -	document = window.document,
      -
      -	// A central reference to the root jQuery(document)
      -	rootjQuery,
      -
      -	// A simple way to check for HTML strings or ID strings
      -	// (both of which we optimize for)
      -	quickExpr = /^[^<]*(<[\w\W]+>)[^>]*$|^#([\w-]+)$/,
      -
      -	// Is it a simple selector
      -	isSimple = /^.[^:#\[\.,]*$/,
      -
      -	// Check if a string has a non-whitespace character in it
      -	rnotwhite = /\S/,
      -
      -	// Used for trimming whitespace
      -	rtrim = /^(\s|\u00A0)+|(\s|\u00A0)+$/g,
      -
      -	// Match a standalone tag
      -	rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>)?$/,
      -
      -	// Keep a UserAgent string for use with jQuery.browser
      -	userAgent = navigator.userAgent,
      -
      -	// For matching the engine and version of the browser
      -	browserMatch,
      -	
      -	// Has the ready events already been bound?
      -	readyBound = false,
      -	
      -	// The functions to execute on DOM ready
      -	readyList = [],
      -
      -	// The ready event handler
      -	DOMContentLoaded,
      -
      -	// Save a reference to some core methods
      -	toString = Object.prototype.toString,
      -	hasOwnProperty = Object.prototype.hasOwnProperty,
      -	push = Array.prototype.push,
      -	slice = Array.prototype.slice,
      -	indexOf = Array.prototype.indexOf;
      -
      -jQuery.fn = jQuery.prototype = {
      -	init: function( selector, context ) {
      -		var match, elem, ret, doc;
      -
      -		// Handle $(""), $(null), or $(undefined)
      -		if ( !selector ) {
      -			return this;
      -		}
      -
      -		// Handle $(DOMElement)
      -		if ( selector.nodeType ) {
      -			this.context = this[0] = selector;
      -			this.length = 1;
      -			return this;
      -		}
      -		
      -		// The body element only exists once, optimize finding it
      -		if ( selector === "body" && !context ) {
      -			this.context = document;
      -			this[0] = document.body;
      -			this.selector = "body";
      -			this.length = 1;
      -			return this;
      -		}
      -
      -		// Handle HTML strings
      -		if ( typeof selector === "string" ) {
      -			// Are we dealing with HTML string or an ID?
      -			match = quickExpr.exec( selector );
      -
      -			// Verify a match, and that no context was specified for #id
      -			if ( match && (match[1] || !context) ) {
      -
      -				// HANDLE: $(html) -> $(array)
      -				if ( match[1] ) {
      -					doc = (context ? context.ownerDocument || context : document);
      -
      -					// If a single string is passed in and it's a single tag
      -					// just do a createElement and skip the rest
      -					ret = rsingleTag.exec( selector );
      -
      -					if ( ret ) {
      -						if ( jQuery.isPlainObject( context ) ) {
      -							selector = [ document.createElement( ret[1] ) ];
      -							jQuery.fn.attr.call( selector, context, true );
      -
      -						} else {
      -							selector = [ doc.createElement( ret[1] ) ];
      -						}
      -
      -					} else {
      -						ret = buildFragment( [ match[1] ], [ doc ] );
      -						selector = (ret.cacheable ? ret.fragment.cloneNode(true) : ret.fragment).childNodes;
      -					}
      -					
      -					return jQuery.merge( this, selector );
      -					
      -				// HANDLE: $("#id")
      -				} else {
      -					elem = document.getElementById( match[2] );
      -
      -					if ( elem ) {
      -						// Handle the case where IE and Opera return items
      -						// by name instead of ID
      -						if ( elem.id !== match[2] ) {
      -							return rootjQuery.find( selector );
      -						}
      -
      -						// Otherwise, we inject the element directly into the jQuery object
      -						this.length = 1;
      -						this[0] = elem;
      -					}
      -
      -					this.context = document;
      -					this.selector = selector;
      -					return this;
      -				}
      -
      -			// HANDLE: $("TAG")
      -			} else if ( !context && /^\w+$/.test( selector ) ) {
      -				this.selector = selector;
      -				this.context = document;
      -				selector = document.getElementsByTagName( selector );
      -				return jQuery.merge( this, selector );
      -
      -			// HANDLE: $(expr, $(...))
      -			} else if ( !context || context.jquery ) {
      -				return (context || rootjQuery).find( selector );
      -
      -			// HANDLE: $(expr, context)
      -			// (which is just equivalent to: $(context).find(expr)
      -			} else {
      -				return jQuery( context ).find( selector );
      -			}
      -
      -		// HANDLE: $(function)
      -		// Shortcut for document ready
      -		} else if ( jQuery.isFunction( selector ) ) {
      -			return rootjQuery.ready( selector );
      -		}
      -
      -		if (selector.selector !== undefined) {
      -			this.selector = selector.selector;
      -			this.context = selector.context;
      -		}
      -
      -		return jQuery.makeArray( selector, this );
      -	},
      -
      -	// Start with an empty selector
      -	selector: "",
      -
      -	// The current version of jQuery being used
      -	jquery: "1.4.2",
      -
      -	// The default length of a jQuery object is 0
      -	length: 0,
      -
      -	// The number of elements contained in the matched element set
      -	size: function() {
      -		return this.length;
      -	},
      -
      -	toArray: function() {
      -		return slice.call( this, 0 );
      -	},
      -
      -	// Get the Nth element in the matched element set OR
      -	// Get the whole matched element set as a clean array
      -	get: function( num ) {
      -		return num == null ?
      -
      -			// Return a 'clean' array
      -			this.toArray() :
      -
      -			// Return just the object
      -			( num < 0 ? this.slice(num)[ 0 ] : this[ num ] );
      -	},
      -
      -	// Take an array of elements and push it onto the stack
      -	// (returning the new matched element set)
      -	pushStack: function( elems, name, selector ) {
      -		// Build a new jQuery matched element set
      -		var ret = jQuery();
      -
      -		if ( jQuery.isArray( elems ) ) {
      -			push.apply( ret, elems );
      -		
      -		} else {
      -			jQuery.merge( ret, elems );
      -		}
      -
      -		// Add the old object onto the stack (as a reference)
      -		ret.prevObject = this;
      -
      -		ret.context = this.context;
      -
      -		if ( name === "find" ) {
      -			ret.selector = this.selector + (this.selector ? " " : "") + selector;
      -		} else if ( name ) {
      -			ret.selector = this.selector + "." + name + "(" + selector + ")";
      -		}
      -
      -		// Return the newly-formed element set
      -		return ret;
      -	},
      -
      -	// Execute a callback for every element in the matched set.
      -	// (You can seed the arguments with an array of args, but this is
      -	// only used internally.)
      -	each: function( callback, args ) {
      -		return jQuery.each( this, callback, args );
      -	},
      -	
      -	ready: function( fn ) {
      -		// Attach the listeners
      -		jQuery.bindReady();
      -
      -		// If the DOM is already ready
      -		if ( jQuery.isReady ) {
      -			// Execute the function immediately
      -			fn.call( document, jQuery );
      -
      -		// Otherwise, remember the function for later
      -		} else if ( readyList ) {
      -			// Add the function to the wait list
      -			readyList.push( fn );
      -		}
      -
      -		return this;
      -	},
      -	
      -	eq: function( i ) {
      -		return i === -1 ?
      -			this.slice( i ) :
      -			this.slice( i, +i + 1 );
      -	},
      -
      -	first: function() {
      -		return this.eq( 0 );
      -	},
      -
      -	last: function() {
      -		return this.eq( -1 );
      -	},
      -
      -	slice: function() {
      -		return this.pushStack( slice.apply( this, arguments ),
      -			"slice", slice.call(arguments).join(",") );
      -	},
      -
      -	map: function( callback ) {
      -		return this.pushStack( jQuery.map(this, function( elem, i ) {
      -			return callback.call( elem, i, elem );
      -		}));
      -	},
      -	
      -	end: function() {
      -		return this.prevObject || jQuery(null);
      -	},
      -
      -	// For internal use only.
      -	// Behaves like an Array's method, not like a jQuery method.
      -	push: push,
      -	sort: [].sort,
      -	splice: [].splice
      -};
      -
      -// Give the init function the jQuery prototype for later instantiation
      -jQuery.fn.init.prototype = jQuery.fn;
      -
      -jQuery.extend = jQuery.fn.extend = function() {
      -	// copy reference to target object
      -	var target = arguments[0] || {}, i = 1, length = arguments.length, deep = false, options, name, src, copy;
      -
      -	// Handle a deep copy situation
      -	if ( typeof target === "boolean" ) {
      -		deep = target;
      -		target = arguments[1] || {};
      -		// skip the boolean and the target
      -		i = 2;
      -	}
      -
      -	// Handle case when target is a string or something (possible in deep copy)
      -	if ( typeof target !== "object" && !jQuery.isFunction(target) ) {
      -		target = {};
      -	}
      -
      -	// extend jQuery itself if only one argument is passed
      -	if ( length === i ) {
      -		target = this;
      -		--i;
      -	}
      -
      -	for ( ; i < length; i++ ) {
      -		// Only deal with non-null/undefined values
      -		if ( (options = arguments[ i ]) != null ) {
      -			// Extend the base object
      -			for ( name in options ) {
      -				src = target[ name ];
      -				copy = options[ name ];
      -
      -				// Prevent never-ending loop
      -				if ( target === copy ) {
      -					continue;
      -				}
      -
      -				// Recurse if we're merging object literal values or arrays
      -				if ( deep && copy && ( jQuery.isPlainObject(copy) || jQuery.isArray(copy) ) ) {
      -					var clone = src && ( jQuery.isPlainObject(src) || jQuery.isArray(src) ) ? src
      -						: jQuery.isArray(copy) ? [] : {};
      -
      -					// Never move original objects, clone them
      -					target[ name ] = jQuery.extend( deep, clone, copy );
      -
      -				// Don't bring in undefined values
      -				} else if ( copy !== undefined ) {
      -					target[ name ] = copy;
      -				}
      -			}
      -		}
      -	}
      -
      -	// Return the modified object
      -	return target;
      -};
      -
      -jQuery.extend({
      -	noConflict: function( deep ) {
      -		window.$ = _$;
      -
      -		if ( deep ) {
      -			window.jQuery = _jQuery;
      -		}
      -
      -		return jQuery;
      -	},
      -	
      -	// Is the DOM ready to be used? Set to true once it occurs.
      -	isReady: false,
      -	
      -	// Handle when the DOM is ready
      -	ready: function() {
      -		// Make sure that the DOM is not already loaded
      -		if ( !jQuery.isReady ) {
      -			// Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
      -			if ( !document.body ) {
      -				return setTimeout( jQuery.ready, 13 );
      -			}
      -
      -			// Remember that the DOM is ready
      -			jQuery.isReady = true;
      -
      -			// If there are functions bound, to execute
      -			if ( readyList ) {
      -				// Execute all of them
      -				var fn, i = 0;
      -				while ( (fn = readyList[ i++ ]) ) {
      -					fn.call( document, jQuery );
      -				}
      -
      -				// Reset the list of functions
      -				readyList = null;
      -			}
      -
      -			// Trigger any bound ready events
      -			if ( jQuery.fn.triggerHandler ) {
      -				jQuery( document ).triggerHandler( "ready" );
      -			}
      -		}
      -	},
      -	
      -	bindReady: function() {
      -		if ( readyBound ) {
      -			return;
      -		}
      -
      -		readyBound = true;
      -
      -		// Catch cases where $(document).ready() is called after the
      -		// browser event has already occurred.
      -		if ( document.readyState === "complete" ) {
      -			return jQuery.ready();
      -		}
      -
      -		// Mozilla, Opera and webkit nightlies currently support this event
      -		if ( document.addEventListener ) {
      -			// Use the handy event callback
      -			document.addEventListener( "DOMContentLoaded", DOMContentLoaded, false );
      -			
      -			// A fallback to window.onload, that will always work
      -			window.addEventListener( "load", jQuery.ready, false );
      -
      -		// If IE event model is used
      -		} else if ( document.attachEvent ) {
      -			// ensure firing before onload,
      -			// maybe late but safe also for iframes
      -			document.attachEvent("onreadystatechange", DOMContentLoaded);
      -			
      -			// A fallback to window.onload, that will always work
      -			window.attachEvent( "onload", jQuery.ready );
      -
      -			// If IE and not a frame
      -			// continually check to see if the document is ready
      -			var toplevel = false;
      -
      -			try {
      -				toplevel = window.frameElement == null;
      -			} catch(e) {}
      -
      -			if ( document.documentElement.doScroll && toplevel ) {
      -				doScrollCheck();
      -			}
      -		}
      -	},
      -
      -	// See test/unit/core.js for details concerning isFunction.
      -	// Since version 1.3, DOM methods and functions like alert
      -	// aren't supported. They return false on IE (#2968).
      -	isFunction: function( obj ) {
      -		return toString.call(obj) === "[object Function]";
      -	},
      -
      -	isArray: function( obj ) {
      -		return toString.call(obj) === "[object Array]";
      -	},
      -
      -	isPlainObject: function( obj ) {
      -		// Must be an Object.
      -		// Because of IE, we also have to check the presence of the constructor property.
      -		// Make sure that DOM nodes and window objects don't pass through, as well
      -		if ( !obj || toString.call(obj) !== "[object Object]" || obj.nodeType || obj.setInterval ) {
      -			return false;
      -		}
      -		
      -		// Not own constructor property must be Object
      -		if ( obj.constructor
      -			&& !hasOwnProperty.call(obj, "constructor")
      -			&& !hasOwnProperty.call(obj.constructor.prototype, "isPrototypeOf") ) {
      -			return false;
      -		}
      -		
      -		// Own properties are enumerated firstly, so to speed up,
      -		// if last one is own, then all properties are own.
      -	
      -		var key;
      -		for ( key in obj ) {}
      -		
      -		return key === undefined || hasOwnProperty.call( obj, key );
      -	},
      -
      -	isEmptyObject: function( obj ) {
      -		for ( var name in obj ) {
      -			return false;
      -		}
      -		return true;
      -	},
      -	
      -	error: function( msg ) {
      -		throw msg;
      -	},
      -	
      -	parseJSON: function( data ) {
      -		if ( typeof data !== "string" || !data ) {
      -			return null;
      -		}
      -
      -		// Make sure leading/trailing whitespace is removed (IE can't handle it)
      -		data = jQuery.trim( data );
      -		
      -		// Make sure the incoming data is actual JSON
      -		// Logic borrowed from http://json.org/json2.js
      -		if ( /^[\],:{}\s]*$/.test(data.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, "@")
      -			.replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, "]")
      -			.replace(/(?:^|:|,)(?:\s*\[)+/g, "")) ) {
      -
      -			// Try to use the native JSON parser first
      -			return window.JSON && window.JSON.parse ?
      -				window.JSON.parse( data ) :
      -				(new Function("return " + data))();
      -
      -		} else {
      -			jQuery.error( "Invalid JSON: " + data );
      -		}
      -	},
      -
      -	noop: function() {},
      -
      -	// Evalulates a script in a global context
      -	globalEval: function( data ) {
      -		if ( data && rnotwhite.test(data) ) {
      -			// Inspired by code by Andrea Giammarchi
      -			// http://webreflection.blogspot.com/2007/08/global-scope-evaluation-and-dom.html
      -			var head = document.getElementsByTagName("head")[0] || document.documentElement,
      -				script = document.createElement("script");
      -
      -			script.type = "text/javascript";
      -
      -			if ( jQuery.support.scriptEval ) {
      -				script.appendChild( document.createTextNode( data ) );
      -			} else {
      -				script.text = data;
      -			}
      -
      -			// Use insertBefore instead of appendChild to circumvent an IE6 bug.
      -			// This arises when a base node is used (#2709).
      -			head.insertBefore( script, head.firstChild );
      -			head.removeChild( script );
      -		}
      -	},
      -
      -	nodeName: function( elem, name ) {
      -		return elem.nodeName && elem.nodeName.toUpperCase() === name.toUpperCase();
      -	},
      -
      -	// args is for internal usage only
      -	each: function( object, callback, args ) {
      -		var name, i = 0,
      -			length = object.length,
      -			isObj = length === undefined || jQuery.isFunction(object);
      -
      -		if ( args ) {
      -			if ( isObj ) {
      -				for ( name in object ) {
      -					if ( callback.apply( object[ name ], args ) === false ) {
      -						break;
      -					}
      -				}
      -			} else {
      -				for ( ; i < length; ) {
      -					if ( callback.apply( object[ i++ ], args ) === false ) {
      -						break;
      -					}
      -				}
      -			}
      -
      -		// A special, fast, case for the most common use of each
      -		} else {
      -			if ( isObj ) {
      -				for ( name in object ) {
      -					if ( callback.call( object[ name ], name, object[ name ] ) === false ) {
      -						break;
      -					}
      -				}
      -			} else {
      -				for ( var value = object[0];
      -					i < length && callback.call( value, i, value ) !== false; value = object[++i] ) {}
      -			}
      -		}
      -
      -		return object;
      -	},
      -
      -	trim: function( text ) {
      -		return (text || "").replace( rtrim, "" );
      -	},
      -
      -	// results is for internal usage only
      -	makeArray: function( array, results ) {
      -		var ret = results || [];
      -
      -		if ( array != null ) {
      -			// The window, strings (and functions) also have 'length'
      -			// The extra typeof function check is to prevent crashes
      -			// in Safari 2 (See: #3039)
      -			if ( array.length == null || typeof array === "string" || jQuery.isFunction(array) || (typeof array !== "function" && array.setInterval) ) {
      -				push.call( ret, array );
      -			} else {
      -				jQuery.merge( ret, array );
      -			}
      -		}
      -
      -		return ret;
      -	},
      -
      -	inArray: function( elem, array ) {
      -		if ( array.indexOf ) {
      -			return array.indexOf( elem );
      -		}
      -
      -		for ( var i = 0, length = array.length; i < length; i++ ) {
      -			if ( array[ i ] === elem ) {
      -				return i;
      -			}
      -		}
      -
      -		return -1;
      -	},
      -
      -	merge: function( first, second ) {
      -		var i = first.length, j = 0;
      -
      -		if ( typeof second.length === "number" ) {
      -			for ( var l = second.length; j < l; j++ ) {
      -				first[ i++ ] = second[ j ];
      -			}
      -		
      -		} else {
      -			while ( second[j] !== undefined ) {
      -				first[ i++ ] = second[ j++ ];
      -			}
      -		}
      -
      -		first.length = i;
      -
      -		return first;
      -	},
      -
      -	grep: function( elems, callback, inv ) {
      -		var ret = [];
      -
      -		// Go through the array, only saving the items
      -		// that pass the validator function
      -		for ( var i = 0, length = elems.length; i < length; i++ ) {
      -			if ( !inv !== !callback( elems[ i ], i ) ) {
      -				ret.push( elems[ i ] );
      -			}
      -		}
      -
      -		return ret;
      -	},
      -
      -	// arg is for internal usage only
      -	map: function( elems, callback, arg ) {
      -		var ret = [], value;
      -
      -		// Go through the array, translating each of the items to their
      -		// new value (or values).
      -		for ( var i = 0, length = elems.length; i < length; i++ ) {
      -			value = callback( elems[ i ], i, arg );
      -
      -			if ( value != null ) {
      -				ret[ ret.length ] = value;
      -			}
      -		}
      -
      -		return ret.concat.apply( [], ret );
      -	},
      -
      -	// A global GUID counter for objects
      -	guid: 1,
      -
      -	proxy: function( fn, proxy, thisObject ) {
      -		if ( arguments.length === 2 ) {
      -			if ( typeof proxy === "string" ) {
      -				thisObject = fn;
      -				fn = thisObject[ proxy ];
      -				proxy = undefined;
      -
      -			} else if ( proxy && !jQuery.isFunction( proxy ) ) {
      -				thisObject = proxy;
      -				proxy = undefined;
      -			}
      -		}
      -
      -		if ( !proxy && fn ) {
      -			proxy = function() {
      -				return fn.apply( thisObject || this, arguments );
      -			};
      -		}
      -
      -		// Set the guid of unique handler to the same of original handler, so it can be removed
      -		if ( fn ) {
      -			proxy.guid = fn.guid = fn.guid || proxy.guid || jQuery.guid++;
      -		}
      -
      -		// So proxy can be declared as an argument
      -		return proxy;
      -	},
      -
      -	// Use of jQuery.browser is frowned upon.
      -	// More details: http://docs.jquery.com/Utilities/jQuery.browser
      -	uaMatch: function( ua ) {
      -		ua = ua.toLowerCase();
      -
      -		var match = /(webkit)[ \/]([\w.]+)/.exec( ua ) ||
      -			/(opera)(?:.*version)?[ \/]([\w.]+)/.exec( ua ) ||
      -			/(msie) ([\w.]+)/.exec( ua ) ||
      -			!/compatible/.test( ua ) && /(mozilla)(?:.*? rv:([\w.]+))?/.exec( ua ) ||
      -		  	[];
      -
      -		return { browser: match[1] || "", version: match[2] || "0" };
      -	},
      -
      -	browser: {}
      -});
      -
      -browserMatch = jQuery.uaMatch( userAgent );
      -if ( browserMatch.browser ) {
      -	jQuery.browser[ browserMatch.browser ] = true;
      -	jQuery.browser.version = browserMatch.version;
      -}
      -
      -// Deprecated, use jQuery.browser.webkit instead
      -if ( jQuery.browser.webkit ) {
      -	jQuery.browser.safari = true;
      -}
      -
      -if ( indexOf ) {
      -	jQuery.inArray = function( elem, array ) {
      -		return indexOf.call( array, elem );
      -	};
      -}
      -
      -// All jQuery objects should point back to these
      -rootjQuery = jQuery(document);
      -
      -// Cleanup functions for the document ready method
      -if ( document.addEventListener ) {
      -	DOMContentLoaded = function() {
      -		document.removeEventListener( "DOMContentLoaded", DOMContentLoaded, false );
      -		jQuery.ready();
      -	};
      -
      -} else if ( document.attachEvent ) {
      -	DOMContentLoaded = function() {
      -		// Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
      -		if ( document.readyState === "complete" ) {
      -			document.detachEvent( "onreadystatechange", DOMContentLoaded );
      -			jQuery.ready();
      -		}
      -	};
      -}
      -
      -// The DOM ready check for Internet Explorer
      -function doScrollCheck() {
      -	if ( jQuery.isReady ) {
      -		return;
      -	}
      -
      -	try {
      -		// If IE is used, use the trick by Diego Perini
      -		// http://javascript.nwbox.com/IEContentLoaded/
      -		document.documentElement.doScroll("left");
      -	} catch( error ) {
      -		setTimeout( doScrollCheck, 1 );
      -		return;
      -	}
      -
      -	// and execute any waiting functions
      -	jQuery.ready();
      -}
      -
      -function evalScript( i, elem ) {
      -	if ( elem.src ) {
      -		jQuery.ajax({
      -			url: elem.src,
      -			async: false,
      -			dataType: "script"
      -		});
      -	} else {
      -		jQuery.globalEval( elem.text || elem.textContent || elem.innerHTML || "" );
      -	}
      -
      -	if ( elem.parentNode ) {
      -		elem.parentNode.removeChild( elem );
      -	}
      -}
      -
      -// Mutifunctional method to get and set values to a collection
      -// The value/s can be optionally by executed if its a function
      -function access( elems, key, value, exec, fn, pass ) {
      -	var length = elems.length;
      -	
      -	// Setting many attributes
      -	if ( typeof key === "object" ) {
      -		for ( var k in key ) {
      -			access( elems, k, key[k], exec, fn, value );
      -		}
      -		return elems;
      -	}
      -	
      -	// Setting one attribute
      -	if ( value !== undefined ) {
      -		// Optionally, function values get executed if exec is true
      -		exec = !pass && exec && jQuery.isFunction(value);
      -		
      -		for ( var i = 0; i < length; i++ ) {
      -			fn( elems[i], key, exec ? value.call( elems[i], i, fn( elems[i], key ) ) : value, pass );
      -		}
      -		
      -		return elems;
      -	}
      -	
      -	// Getting an attribute
      -	return length ? fn( elems[0], key ) : undefined;
      -}
      -
      -function now() {
      -	return (new Date).getTime();
      -}
      -(function() {
      -
      -	jQuery.support = {};
      -
      -	var root = document.documentElement,
      -		script = document.createElement("script"),
      -		div = document.createElement("div"),
      -		id = "script" + now();
      -
      -	div.style.display = "none";
      -	div.innerHTML = "   <link/><table></table><a href='/a' style='color:red;float:left;opacity:.55;'>a</a><input type='checkbox'/>";
      -
      -	var all = div.getElementsByTagName("*"),
      -		a = div.getElementsByTagName("a")[0];
      -
      -	// Can't get basic test support
      -	if ( !all || !all.length || !a ) {
      -		return;
      -	}
      -
      -	jQuery.support = {
      -		// IE strips leading whitespace when .innerHTML is used
      -		leadingWhitespace: div.firstChild.nodeType === 3,
      -
      -		// Make sure that tbody elements aren't automatically inserted
      -		// IE will insert them into empty tables
      -		tbody: !div.getElementsByTagName("tbody").length,
      -
      -		// Make sure that link elements get serialized correctly by innerHTML
      -		// This requires a wrapper element in IE
      -		htmlSerialize: !!div.getElementsByTagName("link").length,
      -
      -		// Get the style information from getAttribute
      -		// (IE uses .cssText insted)
      -		style: /red/.test( a.getAttribute("style") ),
      -
      -		// Make sure that URLs aren't manipulated
      -		// (IE normalizes it by default)
      -		hrefNormalized: a.getAttribute("href") === "/a",
      -
      -		// Make sure that element opacity exists
      -		// (IE uses filter instead)
      -		// Use a regex to work around a WebKit issue. See #5145
      -		opacity: /^0.55$/.test( a.style.opacity ),
      -
      -		// Verify style float existence
      -		// (IE uses styleFloat instead of cssFloat)
      -		cssFloat: !!a.style.cssFloat,
      -
      -		// Make sure that if no value is specified for a checkbox
      -		// that it defaults to "on".
      -		// (WebKit defaults to "" instead)
      -		checkOn: div.getElementsByTagName("input")[0].value === "on",
      -
      -		// Make sure that a selected-by-default option has a working selected property.
      -		// (WebKit defaults to false instead of true, IE too, if it's in an optgroup)
      -		optSelected: document.createElement("select").appendChild( document.createElement("option") ).selected,
      -
      -		parentNode: div.removeChild( div.appendChild( document.createElement("div") ) ).parentNode === null,
      -
      -		// Will be defined later
      -		deleteExpando: true,
      -		checkClone: false,
      -		scriptEval: false,
      -		noCloneEvent: true,
      -		boxModel: null
      -	};
      -
      -	script.type = "text/javascript";
      -	try {
      -		script.appendChild( document.createTextNode( "window." + id + "=1;" ) );
      -	} catch(e) {}
      -
      -	root.insertBefore( script, root.firstChild );
      -
      -	// Make sure that the execution of code works by injecting a script
      -	// tag with appendChild/createTextNode
      -	// (IE doesn't support this, fails, and uses .text instead)
      -	if ( window[ id ] ) {
      -		jQuery.support.scriptEval = true;
      -		delete window[ id ];
      -	}
      -
      -	// Test to see if it's possible to delete an expando from an element
      -	// Fails in Internet Explorer
      -	try {
      -		delete script.test;
      -	
      -	} catch(e) {
      -		jQuery.support.deleteExpando = false;
      -	}
      -
      -	root.removeChild( script );
      -
      -	if ( div.attachEvent && div.fireEvent ) {
      -		div.attachEvent("onclick", function click() {
      -			// Cloning a node shouldn't copy over any
      -			// bound event handlers (IE does this)
      -			jQuery.support.noCloneEvent = false;
      -			div.detachEvent("onclick", click);
      -		});
      -		div.cloneNode(true).fireEvent("onclick");
      -	}
      -
      -	div = document.createElement("div");
      -	div.innerHTML = "<input type='radio' name='radiotest' checked='checked'/>";
      -
      -	var fragment = document.createDocumentFragment();
      -	fragment.appendChild( div.firstChild );
      -
      -	// WebKit doesn't clone checked state correctly in fragments
      -	jQuery.support.checkClone = fragment.cloneNode(true).cloneNode(true).lastChild.checked;
      -
      -	// Figure out if the W3C box model works as expected
      -	// document.body must exist before we can do this
      -	jQuery(function() {
      -		var div = document.createElement("div");
      -		div.style.width = div.style.paddingLeft = "1px";
      -
      -		document.body.appendChild( div );
      -		jQuery.boxModel = jQuery.support.boxModel = div.offsetWidth === 2;
      -		document.body.removeChild( div ).style.display = 'none';
      -
      -		div = null;
      -	});
      -
      -	// Technique from Juriy Zaytsev
      -	// http://thinkweb2.com/projects/prototype/detecting-event-support-without-browser-sniffing/
      -	var eventSupported = function( eventName ) { 
      -		var el = document.createElement("div"); 
      -		eventName = "on" + eventName; 
      -
      -		var isSupported = (eventName in el); 
      -		if ( !isSupported ) { 
      -			el.setAttribute(eventName, "return;"); 
      -			isSupported = typeof el[eventName] === "function"; 
      -		} 
      -		el = null; 
      -
      -		return isSupported; 
      -	};
      -	
      -	jQuery.support.submitBubbles = eventSupported("submit");
      -	jQuery.support.changeBubbles = eventSupported("change");
      -
      -	// release memory in IE
      -	root = script = div = all = a = null;
      -})();
      -
      -jQuery.props = {
      -	"for": "htmlFor",
      -	"class": "className",
      -	readonly: "readOnly",
      -	maxlength: "maxLength",
      -	cellspacing: "cellSpacing",
      -	rowspan: "rowSpan",
      -	colspan: "colSpan",
      -	tabindex: "tabIndex",
      -	usemap: "useMap",
      -	frameborder: "frameBorder"
      -};
      -var expando = "jQuery" + now(), uuid = 0, windowData = {};
      -
      -jQuery.extend({
      -	cache: {},
      -	
      -	expando:expando,
      -
      -	// The following elements throw uncatchable exceptions if you
      -	// attempt to add expando properties to them.
      -	noData: {
      -		"embed": true,
      -		"object": true,
      -		"applet": true
      -	},
      -
      -	data: function( elem, name, data ) {
      -		if ( elem.nodeName && jQuery.noData[elem.nodeName.toLowerCase()] ) {
      -			return;
      -		}
      -
      -		elem = elem == window ?
      -			windowData :
      -			elem;
      -
      -		var id = elem[ expando ], cache = jQuery.cache, thisCache;
      -
      -		if ( !id && typeof name === "string" && data === undefined ) {
      -			return null;
      -		}
      -
      -		// Compute a unique ID for the element
      -		if ( !id ) { 
      -			id = ++uuid;
      -		}
      -
      -		// Avoid generating a new cache unless none exists and we
      -		// want to manipulate it.
      -		if ( typeof name === "object" ) {
      -			elem[ expando ] = id;
      -			thisCache = cache[ id ] = jQuery.extend(true, {}, name);
      -
      -		} else if ( !cache[ id ] ) {
      -			elem[ expando ] = id;
      -			cache[ id ] = {};
      -		}
      -
      -		thisCache = cache[ id ];
      -
      -		// Prevent overriding the named cache with undefined values
      -		if ( data !== undefined ) {
      -			thisCache[ name ] = data;
      -		}
      -
      -		return typeof name === "string" ? thisCache[ name ] : thisCache;
      -	},
      -
      -	removeData: function( elem, name ) {
      -		if ( elem.nodeName && jQuery.noData[elem.nodeName.toLowerCase()] ) {
      -			return;
      -		}
      -
      -		elem = elem == window ?
      -			windowData :
      -			elem;
      -
      -		var id = elem[ expando ], cache = jQuery.cache, thisCache = cache[ id ];
      -
      -		// If we want to remove a specific section of the element's data
      -		if ( name ) {
      -			if ( thisCache ) {
      -				// Remove the section of cache data
      -				delete thisCache[ name ];
      -
      -				// If we've removed all the data, remove the element's cache
      -				if ( jQuery.isEmptyObject(thisCache) ) {
      -					jQuery.removeData( elem );
      -				}
      -			}
      -
      -		// Otherwise, we want to remove all of the element's data
      -		} else {
      -			if ( jQuery.support.deleteExpando ) {
      -				delete elem[ jQuery.expando ];
      -
      -			} else if ( elem.removeAttribute ) {
      -				elem.removeAttribute( jQuery.expando );
      -			}
      -
      -			// Completely remove the data cache
      -			delete cache[ id ];
      -		}
      -	}
      -});
      -
      -jQuery.fn.extend({
      -	data: function( key, value ) {
      -		if ( typeof key === "undefined" && this.length ) {
      -			return jQuery.data( this[0] );
      -
      -		} else if ( typeof key === "object" ) {
      -			return this.each(function() {
      -				jQuery.data( this, key );
      -			});
      -		}
      -
      -		var parts = key.split(".");
      -		parts[1] = parts[1] ? "." + parts[1] : "";
      -
      -		if ( value === undefined ) {
      -			var data = this.triggerHandler("getData" + parts[1] + "!", [parts[0]]);
      -
      -			if ( data === undefined && this.length ) {
      -				data = jQuery.data( this[0], key );
      -			}
      -			return data === undefined && parts[1] ?
      -				this.data( parts[0] ) :
      -				data;
      -		} else {
      -			return this.trigger("setData" + parts[1] + "!", [parts[0], value]).each(function() {
      -				jQuery.data( this, key, value );
      -			});
      -		}
      -	},
      -
      -	removeData: function( key ) {
      -		return this.each(function() {
      -			jQuery.removeData( this, key );
      -		});
      -	}
      -});
      -jQuery.extend({
      -	queue: function( elem, type, data ) {
      -		if ( !elem ) {
      -			return;
      -		}
      -
      -		type = (type || "fx") + "queue";
      -		var q = jQuery.data( elem, type );
      -
      -		// Speed up dequeue by getting out quickly if this is just a lookup
      -		if ( !data ) {
      -			return q || [];
      -		}
      -
      -		if ( !q || jQuery.isArray(data) ) {
      -			q = jQuery.data( elem, type, jQuery.makeArray(data) );
      -
      -		} else {
      -			q.push( data );
      -		}
      -
      -		return q;
      -	},
      -
      -	dequeue: function( elem, type ) {
      -		type = type || "fx";
      -
      -		var queue = jQuery.queue( elem, type ), fn = queue.shift();
      -
      -		// If the fx queue is dequeued, always remove the progress sentinel
      -		if ( fn === "inprogress" ) {
      -			fn = queue.shift();
      -		}
      -
      -		if ( fn ) {
      -			// Add a progress sentinel to prevent the fx queue from being
      -			// automatically dequeued
      -			if ( type === "fx" ) {
      -				queue.unshift("inprogress");
      -			}
      -
      -			fn.call(elem, function() {
      -				jQuery.dequeue(elem, type);
      -			});
      -		}
      -	}
      -});
      -
      -jQuery.fn.extend({
      -	queue: function( type, data ) {
      -		if ( typeof type !== "string" ) {
      -			data = type;
      -			type = "fx";
      -		}
      -
      -		if ( data === undefined ) {
      -			return jQuery.queue( this[0], type );
      -		}
      -		return this.each(function( i, elem ) {
      -			var queue = jQuery.queue( this, type, data );
      -
      -			if ( type === "fx" && queue[0] !== "inprogress" ) {
      -				jQuery.dequeue( this, type );
      -			}
      -		});
      -	},
      -	dequeue: function( type ) {
      -		return this.each(function() {
      -			jQuery.dequeue( this, type );
      -		});
      -	},
      -
      -	// Based off of the plugin by Clint Helfers, with permission.
      -	// http://blindsignals.com/index.php/2009/07/jquery-delay/
      -	delay: function( time, type ) {
      -		time = jQuery.fx ? jQuery.fx.speeds[time] || time : time;
      -		type = type || "fx";
      -
      -		return this.queue( type, function() {
      -			var elem = this;
      -			setTimeout(function() {
      -				jQuery.dequeue( elem, type );
      -			}, time );
      -		});
      -	},
      -
      -	clearQueue: function( type ) {
      -		return this.queue( type || "fx", [] );
      -	}
      -});
      -var rclass = /[\n\t]/g,
      -	rspace = /\s+/,
      -	rreturn = /\r/g,
      -	rspecialurl = /href|src|style/,
      -	rtype = /(button|input)/i,
      -	rfocusable = /(button|input|object|select|textarea)/i,
      -	rclickable = /^(a|area)$/i,
      -	rradiocheck = /radio|checkbox/;
      -
      -jQuery.fn.extend({
      -	attr: function( name, value ) {
      -		return access( this, name, value, true, jQuery.attr );
      -	},
      -
      -	removeAttr: function( name, fn ) {
      -		return this.each(function(){
      -			jQuery.attr( this, name, "" );
      -			if ( this.nodeType === 1 ) {
      -				this.removeAttribute( name );
      -			}
      -		});
      -	},
      -
      -	addClass: function( value ) {
      -		if ( jQuery.isFunction(value) ) {
      -			return this.each(function(i) {
      -				var self = jQuery(this);
      -				self.addClass( value.call(this, i, self.attr("class")) );
      -			});
      -		}
      -
      -		if ( value && typeof value === "string" ) {
      -			var classNames = (value || "").split( rspace );
      -
      -			for ( var i = 0, l = this.length; i < l; i++ ) {
      -				var elem = this[i];
      -
      -				if ( elem.nodeType === 1 ) {
      -					if ( !elem.className ) {
      -						elem.className = value;
      -
      -					} else {
      -						var className = " " + elem.className + " ", setClass = elem.className;
      -						for ( var c = 0, cl = classNames.length; c < cl; c++ ) {
      -							if ( className.indexOf( " " + classNames[c] + " " ) < 0 ) {
      -								setClass += " " + classNames[c];
      -							}
      -						}
      -						elem.className = jQuery.trim( setClass );
      -					}
      -				}
      -			}
      -		}
      -
      -		return this;
      -	},
      -
      -	removeClass: function( value ) {
      -		if ( jQuery.isFunction(value) ) {
      -			return this.each(function(i) {
      -				var self = jQuery(this);
      -				self.removeClass( value.call(this, i, self.attr("class")) );
      -			});
      -		}
      -
      -		if ( (value && typeof value === "string") || value === undefined ) {
      -			var classNames = (value || "").split(rspace);
      -
      -			for ( var i = 0, l = this.length; i < l; i++ ) {
      -				var elem = this[i];
      -
      -				if ( elem.nodeType === 1 && elem.className ) {
      -					if ( value ) {
      -						var className = (" " + elem.className + " ").replace(rclass, " ");
      -						for ( var c = 0, cl = classNames.length; c < cl; c++ ) {
      -							className = className.replace(" " + classNames[c] + " ", " ");
      -						}
      -						elem.className = jQuery.trim( className );
      -
      -					} else {
      -						elem.className = "";
      -					}
      -				}
      -			}
      -		}
      -
      -		return this;
      -	},
      -
      -	toggleClass: function( value, stateVal ) {
      -		var type = typeof value, isBool = typeof stateVal === "boolean";
      -
      -		if ( jQuery.isFunction( value ) ) {
      -			return this.each(function(i) {
      -				var self = jQuery(this);
      -				self.toggleClass( value.call(this, i, self.attr("class"), stateVal), stateVal );
      -			});
      -		}
      -
      -		return this.each(function() {
      -			if ( type === "string" ) {
      -				// toggle individual class names
      -				var className, i = 0, self = jQuery(this),
      -					state = stateVal,
      -					classNames = value.split( rspace );
      -
      -				while ( (className = classNames[ i++ ]) ) {
      -					// check each className given, space seperated list
      -					state = isBool ? state : !self.hasClass( className );
      -					self[ state ? "addClass" : "removeClass" ]( className );
      -				}
      -
      -			} else if ( type === "undefined" || type === "boolean" ) {
      -				if ( this.className ) {
      -					// store className if set
      -					jQuery.data( this, "__className__", this.className );
      -				}
      -
      -				// toggle whole className
      -				this.className = this.className || value === false ? "" : jQuery.data( this, "__className__" ) || "";
      -			}
      -		});
      -	},
      -
      -	hasClass: function( selector ) {
      -		var className = " " + selector + " ";
      -		for ( var i = 0, l = this.length; i < l; i++ ) {
      -			if ( (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) > -1 ) {
      -				return true;
      -			}
      -		}
      -
      -		return false;
      -	},
      -
      -	val: function( value ) {
      -		if ( value === undefined ) {
      -			var elem = this[0];
      -
      -			if ( elem ) {
      -				if ( jQuery.nodeName( elem, "option" ) ) {
      -					return (elem.attributes.value || {}).specified ? elem.value : elem.text;
      -				}
      -
      -				// We need to handle select boxes special
      -				if ( jQuery.nodeName( elem, "select" ) ) {
      -					var index = elem.selectedIndex,
      -						values = [],
      -						options = elem.options,
      -						one = elem.type === "select-one";
      -
      -					// Nothing was selected
      -					if ( index < 0 ) {
      -						return null;
      -					}
      -
      -					// Loop through all the selected options
      -					for ( var i = one ? index : 0, max = one ? index + 1 : options.length; i < max; i++ ) {
      -						var option = options[ i ];
      -
      -						if ( option.selected ) {
      -							// Get the specifc value for the option
      -							value = jQuery(option).val();
      -
      -							// We don't need an array for one selects
      -							if ( one ) {
      -								return value;
      -							}
      -
      -							// Multi-Selects return an array
      -							values.push( value );
      -						}
      -					}
      -
      -					return values;
      -				}
      -
      -				// Handle the case where in Webkit "" is returned instead of "on" if a value isn't specified
      -				if ( rradiocheck.test( elem.type ) && !jQuery.support.checkOn ) {
      -					return elem.getAttribute("value") === null ? "on" : elem.value;
      -				}
      -				
      -
      -				// Everything else, we just grab the value
      -				return (elem.value || "").replace(rreturn, "");
      -
      -			}
      -
      -			return undefined;
      -		}
      -
      -		var isFunction = jQuery.isFunction(value);
      -
      -		return this.each(function(i) {
      -			var self = jQuery(this), val = value;
      -
      -			if ( this.nodeType !== 1 ) {
      -				return;
      -			}
      -
      -			if ( isFunction ) {
      -				val = value.call(this, i, self.val());
      -			}
      -
      -			// Typecast each time if the value is a Function and the appended
      -			// value is therefore different each time.
      -			if ( typeof val === "number" ) {
      -				val += "";
      -			}
      -
      -			if ( jQuery.isArray(val) && rradiocheck.test( this.type ) ) {
      -				this.checked = jQuery.inArray( self.val(), val ) >= 0;
      -
      -			} else if ( jQuery.nodeName( this, "select" ) ) {
      -				var values = jQuery.makeArray(val);
      -
      -				jQuery( "option", this ).each(function() {
      -					this.selected = jQuery.inArray( jQuery(this).val(), values ) >= 0;
      -				});
      -
      -				if ( !values.length ) {
      -					this.selectedIndex = -1;
      -				}
      -
      -			} else {
      -				this.value = val;
      -			}
      -		});
      -	}
      -});
      -
      -jQuery.extend({
      -	attrFn: {
      -		val: true,
      -		css: true,
      -		html: true,
      -		text: true,
      -		data: true,
      -		width: true,
      -		height: true,
      -		offset: true
      -	},
      -		
      -	attr: function( elem, name, value, pass ) {
      -		// don't set attributes on text and comment nodes
      -		if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 ) {
      -			return undefined;
      -		}
      -
      -		if ( pass && name in jQuery.attrFn ) {
      -			return jQuery(elem)[name](value);
      -		}
      -
      -		var notxml = elem.nodeType !== 1 || !jQuery.isXMLDoc( elem ),
      -			// Whether we are setting (or getting)
      -			set = value !== undefined;
      -
      -		// Try to normalize/fix the name
      -		name = notxml && jQuery.props[ name ] || name;
      -
      -		// Only do all the following if this is a node (faster for style)
      -		if ( elem.nodeType === 1 ) {
      -			// These attributes require special treatment
      -			var special = rspecialurl.test( name );
      -
      -			// Safari mis-reports the default selected property of an option
      -			// Accessing the parent's selectedIndex property fixes it
      -			if ( name === "selected" && !jQuery.support.optSelected ) {
      -				var parent = elem.parentNode;
      -				if ( parent ) {
      -					parent.selectedIndex;
      -	
      -					// Make sure that it also works with optgroups, see #5701
      -					if ( parent.parentNode ) {
      -						parent.parentNode.selectedIndex;
      -					}
      -				}
      -			}
      -
      -			// If applicable, access the attribute via the DOM 0 way
      -			if ( name in elem && notxml && !special ) {
      -				if ( set ) {
      -					// We can't allow the type property to be changed (since it causes problems in IE)
      -					if ( name === "type" && rtype.test( elem.nodeName ) && elem.parentNode ) {
      -						jQuery.error( "type property can't be changed" );
      -					}
      -
      -					elem[ name ] = value;
      -				}
      -
      -				// browsers index elements by id/name on forms, give priority to attributes.
      -				if ( jQuery.nodeName( elem, "form" ) && elem.getAttributeNode(name) ) {
      -					return elem.getAttributeNode( name ).nodeValue;
      -				}
      -
      -				// elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set
      -				// http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
      -				if ( name === "tabIndex" ) {
      -					var attributeNode = elem.getAttributeNode( "tabIndex" );
      -
      -					return attributeNode && attributeNode.specified ?
      -						attributeNode.value :
      -						rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ?
      -							0 :
      -							undefined;
      -				}
      -
      -				return elem[ name ];
      -			}
      -
      -			if ( !jQuery.support.style && notxml && name === "style" ) {
      -				if ( set ) {
      -					elem.style.cssText = "" + value;
      -				}
      -
      -				return elem.style.cssText;
      -			}
      -
      -			if ( set ) {
      -				// convert the value to a string (all browsers do this but IE) see #1070
      -				elem.setAttribute( name, "" + value );
      -			}
      -
      -			var attr = !jQuery.support.hrefNormalized && notxml && special ?
      -					// Some attributes require a special call on IE
      -					elem.getAttribute( name, 2 ) :
      -					elem.getAttribute( name );
      -
      -			// Non-existent attributes return null, we normalize to undefined
      -			return attr === null ? undefined : attr;
      -		}
      -
      -		// elem is actually elem.style ... set the style
      -		// Using attr for specific style information is now deprecated. Use style instead.
      -		return jQuery.style( elem, name, value );
      -	}
      -});
      -var rnamespaces = /\.(.*)$/,
      -	fcleanup = function( nm ) {
      -		return nm.replace(/[^\w\s\.\|`]/g, function( ch ) {
      -			return "\\" + ch;
      -		});
      -	};
      -
      -/*
      - * A number of helper functions used for managing events.
      - * Many of the ideas behind this code originated from
      - * Dean Edwards' addEvent library.
      - */
      -jQuery.event = {
      -
      -	// Bind an event to an element
      -	// Original by Dean Edwards
      -	add: function( elem, types, handler, data ) {
      -		if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
      -			return;
      -		}
      -
      -		// For whatever reason, IE has trouble passing the window object
      -		// around, causing it to be cloned in the process
      -		if ( elem.setInterval && ( elem !== window && !elem.frameElement ) ) {
      -			elem = window;
      -		}
      -
      -		var handleObjIn, handleObj;
      -
      -		if ( handler.handler ) {
      -			handleObjIn = handler;
      -			handler = handleObjIn.handler;
      -		}
      -
      -		// Make sure that the function being executed has a unique ID
      -		if ( !handler.guid ) {
      -			handler.guid = jQuery.guid++;
      -		}
      -
      -		// Init the element's event structure
      -		var elemData = jQuery.data( elem );
      -
      -		// If no elemData is found then we must be trying to bind to one of the
      -		// banned noData elements
      -		if ( !elemData ) {
      -			return;
      -		}
      -
      -		var events = elemData.events = elemData.events || {},
      -			eventHandle = elemData.handle, eventHandle;
      -
      -		if ( !eventHandle ) {
      -			elemData.handle = eventHandle = function() {
      -				// Handle the second event of a trigger and when
      -				// an event is called after a page has unloaded
      -				return typeof jQuery !== "undefined" && !jQuery.event.triggered ?
      -					jQuery.event.handle.apply( eventHandle.elem, arguments ) :
      -					undefined;
      -			};
      -		}
      -
      -		// Add elem as a property of the handle function
      -		// This is to prevent a memory leak with non-native events in IE.
      -		eventHandle.elem = elem;
      -
      -		// Handle multiple events separated by a space
      -		// jQuery(...).bind("mouseover mouseout", fn);
      -		types = types.split(" ");
      -
      -		var type, i = 0, namespaces;
      -
      -		while ( (type = types[ i++ ]) ) {
      -			handleObj = handleObjIn ?
      -				jQuery.extend({}, handleObjIn) :
      -				{ handler: handler, data: data };
      -
      -			// Namespaced event handlers
      -			if ( type.indexOf(".") > -1 ) {
      -				namespaces = type.split(".");
      -				type = namespaces.shift();
      -				handleObj.namespace = namespaces.slice(0).sort().join(".");
      -
      -			} else {
      -				namespaces = [];
      -				handleObj.namespace = "";
      -			}
      -
      -			handleObj.type = type;
      -			handleObj.guid = handler.guid;
      -
      -			// Get the current list of functions bound to this event
      -			var handlers = events[ type ],
      -				special = jQuery.event.special[ type ] || {};
      -
      -			// Init the event handler queue
      -			if ( !handlers ) {
      -				handlers = events[ type ] = [];
      -
      -				// Check for a special event handler
      -				// Only use addEventListener/attachEvent if the special
      -				// events handler returns false
      -				if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) {
      -					// Bind the global event handler to the element
      -					if ( elem.addEventListener ) {
      -						elem.addEventListener( type, eventHandle, false );
      -
      -					} else if ( elem.attachEvent ) {
      -						elem.attachEvent( "on" + type, eventHandle );
      -					}
      -				}
      -			}
      -			
      -			if ( special.add ) { 
      -				special.add.call( elem, handleObj ); 
      -
      -				if ( !handleObj.handler.guid ) {
      -					handleObj.handler.guid = handler.guid;
      -				}
      -			}
      -
      -			// Add the function to the element's handler list
      -			handlers.push( handleObj );
      -
      -			// Keep track of which events have been used, for global triggering
      -			jQuery.event.global[ type ] = true;
      -		}
      -
      -		// Nullify elem to prevent memory leaks in IE
      -		elem = null;
      -	},
      -
      -	global: {},
      -
      -	// Detach an event or set of events from an element
      -	remove: function( elem, types, handler, pos ) {
      -		// don't do events on text and comment nodes
      -		if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
      -			return;
      -		}
      -
      -		var ret, type, fn, i = 0, all, namespaces, namespace, special, eventType, handleObj, origType,
      -			elemData = jQuery.data( elem ),
      -			events = elemData && elemData.events;
      -
      -		if ( !elemData || !events ) {
      -			return;
      -		}
      -
      -		// types is actually an event object here
      -		if ( types && types.type ) {
      -			handler = types.handler;
      -			types = types.type;
      -		}
      -
      -		// Unbind all events for the element
      -		if ( !types || typeof types === "string" && types.charAt(0) === "." ) {
      -			types = types || "";
      -
      -			for ( type in events ) {
      -				jQuery.event.remove( elem, type + types );
      -			}
      -
      -			return;
      -		}
      -
      -		// Handle multiple events separated by a space
      -		// jQuery(...).unbind("mouseover mouseout", fn);
      -		types = types.split(" ");
      -
      -		while ( (type = types[ i++ ]) ) {
      -			origType = type;
      -			handleObj = null;
      -			all = type.indexOf(".") < 0;
      -			namespaces = [];
      -
      -			if ( !all ) {
      -				// Namespaced event handlers
      -				namespaces = type.split(".");
      -				type = namespaces.shift();
      -
      -				namespace = new RegExp("(^|\\.)" + 
      -					jQuery.map( namespaces.slice(0).sort(), fcleanup ).join("\\.(?:.*\\.)?") + "(\\.|$)")
      -			}
      -
      -			eventType = events[ type ];
      -
      -			if ( !eventType ) {
      -				continue;
      -			}
      -
      -			if ( !handler ) {
      -				for ( var j = 0; j < eventType.length; j++ ) {
      -					handleObj = eventType[ j ];
      -
      -					if ( all || namespace.test( handleObj.namespace ) ) {
      -						jQuery.event.remove( elem, origType, handleObj.handler, j );
      -						eventType.splice( j--, 1 );
      -					}
      -				}
      -
      -				continue;
      -			}
      -
      -			special = jQuery.event.special[ type ] || {};
      -
      -			for ( var j = pos || 0; j < eventType.length; j++ ) {
      -				handleObj = eventType[ j ];
      -
      -				if ( handler.guid === handleObj.guid ) {
      -					// remove the given handler for the given type
      -					if ( all || namespace.test( handleObj.namespace ) ) {
      -						if ( pos == null ) {
      -							eventType.splice( j--, 1 );
      -						}
      -
      -						if ( special.remove ) {
      -							special.remove.call( elem, handleObj );
      -						}
      -					}
      -
      -					if ( pos != null ) {
      -						break;
      -					}
      -				}
      -			}
      -
      -			// remove generic event handler if no more handlers exist
      -			if ( eventType.length === 0 || pos != null && eventType.length === 1 ) {
      -				if ( !special.teardown || special.teardown.call( elem, namespaces ) === false ) {
      -					removeEvent( elem, type, elemData.handle );
      -				}
      -
      -				ret = null;
      -				delete events[ type ];
      -			}
      -		}
      -
      -		// Remove the expando if it's no longer used
      -		if ( jQuery.isEmptyObject( events ) ) {
      -			var handle = elemData.handle;
      -			if ( handle ) {
      -				handle.elem = null;
      -			}
      -
      -			delete elemData.events;
      -			delete elemData.handle;
      -
      -			if ( jQuery.isEmptyObject( elemData ) ) {
      -				jQuery.removeData( elem );
      -			}
      -		}
      -	},
      -
      -	// bubbling is internal
      -	trigger: function( event, data, elem /*, bubbling */ ) {
      -		// Event object or event type
      -		var type = event.type || event,
      -			bubbling = arguments[3];
      -
      -		if ( !bubbling ) {
      -			event = typeof event === "object" ?
      -				// jQuery.Event object
      -				event[expando] ? event :
      -				// Object literal
      -				jQuery.extend( jQuery.Event(type), event ) :
      -				// Just the event type (string)
      -				jQuery.Event(type);
      -
      -			if ( type.indexOf("!") >= 0 ) {
      -				event.type = type = type.slice(0, -1);
      -				event.exclusive = true;
      -			}
      -
      -			// Handle a global trigger
      -			if ( !elem ) {
      -				// Don't bubble custom events when global (to avoid too much overhead)
      -				event.stopPropagation();
      -
      -				// Only trigger if we've ever bound an event for it
      -				if ( jQuery.event.global[ type ] ) {
      -					jQuery.each( jQuery.cache, function() {
      -						if ( this.events && this.events[type] ) {
      -							jQuery.event.trigger( event, data, this.handle.elem );
      -						}
      -					});
      -				}
      -			}
      -
      -			// Handle triggering a single element
      -
      -			// don't do events on text and comment nodes
      -			if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 ) {
      -				return undefined;
      -			}
      -
      -			// Clean up in case it is reused
      -			event.result = undefined;
      -			event.target = elem;
      -
      -			// Clone the incoming data, if any
      -			data = jQuery.makeArray( data );
      -			data.unshift( event );
      -		}
      -
      -		event.currentTarget = elem;
      -
      -		// Trigger the event, it is assumed that "handle" is a function
      -		var handle = jQuery.data( elem, "handle" );
      -		if ( handle ) {
      -			handle.apply( elem, data );
      -		}
      -
      -		var parent = elem.parentNode || elem.ownerDocument;
      -
      -		// Trigger an inline bound script
      -		try {
      -			if ( !(elem && elem.nodeName && jQuery.noData[elem.nodeName.toLowerCase()]) ) {
      -				if ( elem[ "on" + type ] && elem[ "on" + type ].apply( elem, data ) === false ) {
      -					event.result = false;
      -				}
      -			}
      -
      -		// prevent IE from throwing an error for some elements with some event types, see #3533
      -		} catch (e) {}
      -
      -		if ( !event.isPropagationStopped() && parent ) {
      -			jQuery.event.trigger( event, data, parent, true );
      -
      -		} else if ( !event.isDefaultPrevented() ) {
      -			var target = event.target, old,
      -				isClick = jQuery.nodeName(target, "a") && type === "click",
      -				special = jQuery.event.special[ type ] || {};
      -
      -			if ( (!special._default || special._default.call( elem, event ) === false) && 
      -				!isClick && !(target && target.nodeName && jQuery.noData[target.nodeName.toLowerCase()]) ) {
      -
      -				try {
      -					if ( target[ type ] ) {
      -						// Make sure that we don't accidentally re-trigger the onFOO events
      -						old = target[ "on" + type ];
      -
      -						if ( old ) {
      -							target[ "on" + type ] = null;
      -						}
      -
      -						jQuery.event.triggered = true;
      -						target[ type ]();
      -					}
      -
      -				// prevent IE from throwing an error for some elements with some event types, see #3533
      -				} catch (e) {}
      -
      -				if ( old ) {
      -					target[ "on" + type ] = old;
      -				}
      -
      -				jQuery.event.triggered = false;
      -			}
      -		}
      -	},
      -
      -	handle: function( event ) {
      -		var all, handlers, namespaces, namespace, events;
      -
      -		event = arguments[0] = jQuery.event.fix( event || window.event );
      -		event.currentTarget = this;
      -
      -		// Namespaced event handlers
      -		all = event.type.indexOf(".") < 0 && !event.exclusive;
      -
      -		if ( !all ) {
      -			namespaces = event.type.split(".");
      -			event.type = namespaces.shift();
      -			namespace = new RegExp("(^|\\.)" + namespaces.slice(0).sort().join("\\.(?:.*\\.)?") + "(\\.|$)");
      -		}
      -
      -		var events = jQuery.data(this, "events"), handlers = events[ event.type ];
      -
      -		if ( events && handlers ) {
      -			// Clone the handlers to prevent manipulation
      -			handlers = handlers.slice(0);
      -
      -			for ( var j = 0, l = handlers.length; j < l; j++ ) {
      -				var handleObj = handlers[ j ];
      -
      -				// Filter the functions by class
      -				if ( all || namespace.test( handleObj.namespace ) ) {
      -					// Pass in a reference to the handler function itself
      -					// So that we can later remove it
      -					event.handler = handleObj.handler;
      -					event.data = handleObj.data;
      -					event.handleObj = handleObj;
      -	
      -					var ret = handleObj.handler.apply( this, arguments );
      -
      -					if ( ret !== undefined ) {
      -						event.result = ret;
      -						if ( ret === false ) {
      -							event.preventDefault();
      -							event.stopPropagation();
      -						}
      -					}
      -
      -					if ( event.isImmediatePropagationStopped() ) {
      -						break;
      -					}
      -				}
      -			}
      -		}
      -
      -		return event.result;
      -	},
      -
      -	props: "altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),
      -
      -	fix: function( event ) {
      -		if ( event[ expando ] ) {
      -			return event;
      -		}
      -
      -		// store a copy of the original event object
      -		// and "clone" to set read-only properties
      -		var originalEvent = event;
      -		event = jQuery.Event( originalEvent );
      -
      -		for ( var i = this.props.length, prop; i; ) {
      -			prop = this.props[ --i ];
      -			event[ prop ] = originalEvent[ prop ];
      -		}
      -
      -		// Fix target property, if necessary
      -		if ( !event.target ) {
      -			event.target = event.srcElement || document; // Fixes #1925 where srcElement might not be defined either
      -		}
      -
      -		// check if target is a textnode (safari)
      -		if ( event.target.nodeType === 3 ) {
      -			event.target = event.target.parentNode;
      -		}
      -
      -		// Add relatedTarget, if necessary
      -		if ( !event.relatedTarget && event.fromElement ) {
      -			event.relatedTarget = event.fromElement === event.target ? event.toElement : event.fromElement;
      -		}
      -
      -		// Calculate pageX/Y if missing and clientX/Y available
      -		if ( event.pageX == null && event.clientX != null ) {
      -			var doc = document.documentElement, body = document.body;
      -			event.pageX = event.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0) - (doc && doc.clientLeft || body && body.clientLeft || 0);
      -			event.pageY = event.clientY + (doc && doc.scrollTop  || body && body.scrollTop  || 0) - (doc && doc.clientTop  || body && body.clientTop  || 0);
      -		}
      -
      -		// Add which for key events
      -		if ( !event.which && ((event.charCode || event.charCode === 0) ? event.charCode : event.keyCode) ) {
      -			event.which = event.charCode || event.keyCode;
      -		}
      -
      -		// Add metaKey to non-Mac browsers (use ctrl for PC's and Meta for Macs)
      -		if ( !event.metaKey && event.ctrlKey ) {
      -			event.metaKey = event.ctrlKey;
      -		}
      -
      -		// Add which for click: 1 === left; 2 === middle; 3 === right
      -		// Note: button is not normalized, so don't use it
      -		if ( !event.which && event.button !== undefined ) {
      -			event.which = (event.button & 1 ? 1 : ( event.button & 2 ? 3 : ( event.button & 4 ? 2 : 0 ) ));
      -		}
      -
      -		return event;
      -	},
      -
      -	// Deprecated, use jQuery.guid instead
      -	guid: 1E8,
      -
      -	// Deprecated, use jQuery.proxy instead
      -	proxy: jQuery.proxy,
      -
      -	special: {
      -		ready: {
      -			// Make sure the ready event is setup
      -			setup: jQuery.bindReady,
      -			teardown: jQuery.noop
      -		},
      -
      -		live: {
      -			add: function( handleObj ) {
      -				jQuery.event.add( this, handleObj.origType, jQuery.extend({}, handleObj, {handler: liveHandler}) ); 
      -			},
      -
      -			remove: function( handleObj ) {
      -				var remove = true,
      -					type = handleObj.origType.replace(rnamespaces, "");
      -				
      -				jQuery.each( jQuery.data(this, "events").live || [], function() {
      -					if ( type === this.origType.replace(rnamespaces, "") ) {
      -						remove = false;
      -						return false;
      -					}
      -				});
      -
      -				if ( remove ) {
      -					jQuery.event.remove( this, handleObj.origType, liveHandler );
      -				}
      -			}
      -
      -		},
      -
      -		beforeunload: {
      -			setup: function( data, namespaces, eventHandle ) {
      -				// We only want to do this special case on windows
      -				if ( this.setInterval ) {
      -					this.onbeforeunload = eventHandle;
      -				}
      -
      -				return false;
      -			},
      -			teardown: function( namespaces, eventHandle ) {
      -				if ( this.onbeforeunload === eventHandle ) {
      -					this.onbeforeunload = null;
      -				}
      -			}
      -		}
      -	}
      -};
      -
      -var removeEvent = document.removeEventListener ?
      -	function( elem, type, handle ) {
      -		elem.removeEventListener( type, handle, false );
      -	} : 
      -	function( elem, type, handle ) {
      -		elem.detachEvent( "on" + type, handle );
      -	};
      -
      -jQuery.Event = function( src ) {
      -	// Allow instantiation without the 'new' keyword
      -	if ( !this.preventDefault ) {
      -		return new jQuery.Event( src );
      -	}
      -
      -	// Event object
      -	if ( src && src.type ) {
      -		this.originalEvent = src;
      -		this.type = src.type;
      -	// Event type
      -	} else {
      -		this.type = src;
      -	}
      -
      -	// timeStamp is buggy for some events on Firefox(#3843)
      -	// So we won't rely on the native value
      -	this.timeStamp = now();
      -
      -	// Mark it as fixed
      -	this[ expando ] = true;
      -};
      -
      -function returnFalse() {
      -	return false;
      -}
      -function returnTrue() {
      -	return true;
      -}
      -
      -// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding
      -// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html
      -jQuery.Event.prototype = {
      -	preventDefault: function() {
      -		this.isDefaultPrevented = returnTrue;
      -
      -		var e = this.originalEvent;
      -		if ( !e ) {
      -			return;
      -		}
      -		
      -		// if preventDefault exists run it on the original event
      -		if ( e.preventDefault ) {
      -			e.preventDefault();
      -		}
      -		// otherwise set the returnValue property of the original event to false (IE)
      -		e.returnValue = false;
      -	},
      -	stopPropagation: function() {
      -		this.isPropagationStopped = returnTrue;
      -
      -		var e = this.originalEvent;
      -		if ( !e ) {
      -			return;
      -		}
      -		// if stopPropagation exists run it on the original event
      -		if ( e.stopPropagation ) {
      -			e.stopPropagation();
      -		}
      -		// otherwise set the cancelBubble property of the original event to true (IE)
      -		e.cancelBubble = true;
      -	},
      -	stopImmediatePropagation: function() {
      -		this.isImmediatePropagationStopped = returnTrue;
      -		this.stopPropagation();
      -	},
      -	isDefaultPrevented: returnFalse,
      -	isPropagationStopped: returnFalse,
      -	isImmediatePropagationStopped: returnFalse
      -};
      -
      -// Checks if an event happened on an element within another element
      -// Used in jQuery.event.special.mouseenter and mouseleave handlers
      -var withinElement = function( event ) {
      -	// Check if mouse(over|out) are still within the same parent element
      -	var parent = event.relatedTarget;
      -
      -	// Firefox sometimes assigns relatedTarget a XUL element
      -	// which we cannot access the parentNode property of
      -	try {
      -		// Traverse up the tree
      -		while ( parent && parent !== this ) {
      -			parent = parent.parentNode;
      -		}
      -
      -		if ( parent !== this ) {
      -			// set the correct event type
      -			event.type = event.data;
      -
      -			// handle event if we actually just moused on to a non sub-element
      -			jQuery.event.handle.apply( this, arguments );
      -		}
      -
      -	// assuming we've left the element since we most likely mousedover a xul element
      -	} catch(e) { }
      -},
      -
      -// In case of event delegation, we only need to rename the event.type,
      -// liveHandler will take care of the rest.
      -delegate = function( event ) {
      -	event.type = event.data;
      -	jQuery.event.handle.apply( this, arguments );
      -};
      -
      -// Create mouseenter and mouseleave events
      -jQuery.each({
      -	mouseenter: "mouseover",
      -	mouseleave: "mouseout"
      -}, function( orig, fix ) {
      -	jQuery.event.special[ orig ] = {
      -		setup: function( data ) {
      -			jQuery.event.add( this, fix, data && data.selector ? delegate : withinElement, orig );
      -		},
      -		teardown: function( data ) {
      -			jQuery.event.remove( this, fix, data && data.selector ? delegate : withinElement );
      -		}
      -	};
      -});
      -
      -// submit delegation
      -if ( !jQuery.support.submitBubbles ) {
      -
      -	jQuery.event.special.submit = {
      -		setup: function( data, namespaces ) {
      -			if ( this.nodeName.toLowerCase() !== "form" ) {
      -				jQuery.event.add(this, "click.specialSubmit", function( e ) {
      -					var elem = e.target, type = elem.type;
      -
      -					if ( (type === "submit" || type === "image") && jQuery( elem ).closest("form").length ) {
      -						return trigger( "submit", this, arguments );
      -					}
      -				});
      -	 
      -				jQuery.event.add(this, "keypress.specialSubmit", function( e ) {
      -					var elem = e.target, type = elem.type;
      -
      -					if ( (type === "text" || type === "password") && jQuery( elem ).closest("form").length && e.keyCode === 13 ) {
      -						return trigger( "submit", this, arguments );
      -					}
      -				});
      -
      -			} else {
      -				return false;
      -			}
      -		},
      -
      -		teardown: function( namespaces ) {
      -			jQuery.event.remove( this, ".specialSubmit" );
      -		}
      -	};
      -
      -}
      -
      -// change delegation, happens here so we have bind.
      -if ( !jQuery.support.changeBubbles ) {
      -
      -	var formElems = /textarea|input|select/i,
      -
      -	changeFilters,
      -
      -	getVal = function( elem ) {
      -		var type = elem.type, val = elem.value;
      -
      -		if ( type === "radio" || type === "checkbox" ) {
      -			val = elem.checked;
      -
      -		} else if ( type === "select-multiple" ) {
      -			val = elem.selectedIndex > -1 ?
      -				jQuery.map( elem.options, function( elem ) {
      -					return elem.selected;
      -				}).join("-") :
      -				"";
      -
      -		} else if ( elem.nodeName.toLowerCase() === "select" ) {
      -			val = elem.selectedIndex;
      -		}
      -
      -		return val;
      -	},
      -
      -	testChange = function testChange( e ) {
      -		var elem = e.target, data, val;
      -
      -		if ( !formElems.test( elem.nodeName ) || elem.readOnly ) {
      -			return;
      -		}
      -
      -		data = jQuery.data( elem, "_change_data" );
      -		val = getVal(elem);
      -
      -		// the current data will be also retrieved by beforeactivate
      -		if ( e.type !== "focusout" || elem.type !== "radio" ) {
      -			jQuery.data( elem, "_change_data", val );
      -		}
      -		
      -		if ( data === undefined || val === data ) {
      -			return;
      -		}
      -
      -		if ( data != null || val ) {
      -			e.type = "change";
      -			return jQuery.event.trigger( e, arguments[1], elem );
      -		}
      -	};
      -
      -	jQuery.event.special.change = {
      -		filters: {
      -			focusout: testChange, 
      -
      -			click: function( e ) {
      -				var elem = e.target, type = elem.type;
      -
      -				if ( type === "radio" || type === "checkbox" || elem.nodeName.toLowerCase() === "select" ) {
      -					return testChange.call( this, e );
      -				}
      -			},
      -
      -			// Change has to be called before submit
      -			// Keydown will be called before keypress, which is used in submit-event delegation
      -			keydown: function( e ) {
      -				var elem = e.target, type = elem.type;
      -
      -				if ( (e.keyCode === 13 && elem.nodeName.toLowerCase() !== "textarea") ||
      -					(e.keyCode === 32 && (type === "checkbox" || type === "radio")) ||
      -					type === "select-multiple" ) {
      -					return testChange.call( this, e );
      -				}
      -			},
      -
      -			// Beforeactivate happens also before the previous element is blurred
      -			// with this event you can't trigger a change event, but you can store
      -			// information/focus[in] is not needed anymore
      -			beforeactivate: function( e ) {
      -				var elem = e.target;
      -				jQuery.data( elem, "_change_data", getVal(elem) );
      -			}
      -		},
      -
      -		setup: function( data, namespaces ) {
      -			if ( this.type === "file" ) {
      -				return false;
      -			}
      -
      -			for ( var type in changeFilters ) {
      -				jQuery.event.add( this, type + ".specialChange", changeFilters[type] );
      -			}
      -
      -			return formElems.test( this.nodeName );
      -		},
      -
      -		teardown: function( namespaces ) {
      -			jQuery.event.remove( this, ".specialChange" );
      -
      -			return formElems.test( this.nodeName );
      -		}
      -	};
      -
      -	changeFilters = jQuery.event.special.change.filters;
      -}
      -
      -function trigger( type, elem, args ) {
      -	args[0].type = type;
      -	return jQuery.event.handle.apply( elem, args );
      -}
      -
      -// Create "bubbling" focus and blur events
      -if ( document.addEventListener ) {
      -	jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) {
      -		jQuery.event.special[ fix ] = {
      -			setup: function() {
      -				this.addEventListener( orig, handler, true );
      -			}, 
      -			teardown: function() { 
      -				this.removeEventListener( orig, handler, true );
      -			}
      -		};
      -
      -		function handler( e ) { 
      -			e = jQuery.event.fix( e );
      -			e.type = fix;
      -			return jQuery.event.handle.call( this, e );
      -		}
      -	});
      -}
      -
      -jQuery.each(["bind", "one"], function( i, name ) {
      -	jQuery.fn[ name ] = function( type, data, fn ) {
      -		// Handle object literals
      -		if ( typeof type === "object" ) {
      -			for ( var key in type ) {
      -				this[ name ](key, data, type[key], fn);
      -			}
      -			return this;
      -		}
      -		
      -		if ( jQuery.isFunction( data ) ) {
      -			fn = data;
      -			data = undefined;
      -		}
      -
      -		var handler = name === "one" ? jQuery.proxy( fn, function( event ) {
      -			jQuery( this ).unbind( event, handler );
      -			return fn.apply( this, arguments );
      -		}) : fn;
      -
      -		if ( type === "unload" && name !== "one" ) {
      -			this.one( type, data, fn );
      -
      -		} else {
      -			for ( var i = 0, l = this.length; i < l; i++ ) {
      -				jQuery.event.add( this[i], type, handler, data );
      -			}
      -		}
      -
      -		return this;
      -	};
      -});
      -
      -jQuery.fn.extend({
      -	unbind: function( type, fn ) {
      -		// Handle object literals
      -		if ( typeof type === "object" && !type.preventDefault ) {
      -			for ( var key in type ) {
      -				this.unbind(key, type[key]);
      -			}
      -
      -		} else {
      -			for ( var i = 0, l = this.length; i < l; i++ ) {
      -				jQuery.event.remove( this[i], type, fn );
      -			}
      -		}
      -
      -		return this;
      -	},
      -	
      -	delegate: function( selector, types, data, fn ) {
      -		return this.live( types, data, fn, selector );
      -	},
      -	
      -	undelegate: function( selector, types, fn ) {
      -		if ( arguments.length === 0 ) {
      -				return this.unbind( "live" );
      -		
      -		} else {
      -			return this.die( types, null, fn, selector );
      -		}
      -	},
      -	
      -	trigger: function( type, data ) {
      -		return this.each(function() {
      -			jQuery.event.trigger( type, data, this );
      -		});
      -	},
      -
      -	triggerHandler: function( type, data ) {
      -		if ( this[0] ) {
      -			var event = jQuery.Event( type );
      -			event.preventDefault();
      -			event.stopPropagation();
      -			jQuery.event.trigger( event, data, this[0] );
      -			return event.result;
      -		}
      -	},
      -
      -	toggle: function( fn ) {
      -		// Save reference to arguments for access in closure
      -		var args = arguments, i = 1;
      -
      -		// link all the functions, so any of them can unbind this click handler
      -		while ( i < args.length ) {
      -			jQuery.proxy( fn, args[ i++ ] );
      -		}
      -
      -		return this.click( jQuery.proxy( fn, function( event ) {
      -			// Figure out which function to execute
      -			var lastToggle = ( jQuery.data( this, "lastToggle" + fn.guid ) || 0 ) % i;
      -			jQuery.data( this, "lastToggle" + fn.guid, lastToggle + 1 );
      -
      -			// Make sure that clicks stop
      -			event.preventDefault();
      -
      -			// and execute the function
      -			return args[ lastToggle ].apply( this, arguments ) || false;
      -		}));
      -	},
      -
      -	hover: function( fnOver, fnOut ) {
      -		return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );
      -	}
      -});
      -
      -var liveMap = {
      -	focus: "focusin",
      -	blur: "focusout",
      -	mouseenter: "mouseover",
      -	mouseleave: "mouseout"
      -};
      -
      -jQuery.each(["live", "die"], function( i, name ) {
      -	jQuery.fn[ name ] = function( types, data, fn, origSelector /* Internal Use Only */ ) {
      -		var type, i = 0, match, namespaces, preType,
      -			selector = origSelector || this.selector,
      -			context = origSelector ? this : jQuery( this.context );
      -
      -		if ( jQuery.isFunction( data ) ) {
      -			fn = data;
      -			data = undefined;
      -		}
      -
      -		types = (types || "").split(" ");
      -
      -		while ( (type = types[ i++ ]) != null ) {
      -			match = rnamespaces.exec( type );
      -			namespaces = "";
      -
      -			if ( match )  {
      -				namespaces = match[0];
      -				type = type.replace( rnamespaces, "" );
      -			}
      -
      -			if ( type === "hover" ) {
      -				types.push( "mouseenter" + namespaces, "mouseleave" + namespaces );
      -				continue;
      -			}
      -
      -			preType = type;
      -
      -			if ( type === "focus" || type === "blur" ) {
      -				types.push( liveMap[ type ] + namespaces );
      -				type = type + namespaces;
      -
      -			} else {
      -				type = (liveMap[ type ] || type) + namespaces;
      -			}
      -
      -			if ( name === "live" ) {
      -				// bind live handler
      -				context.each(function(){
      -					jQuery.event.add( this, liveConvert( type, selector ),
      -						{ data: data, selector: selector, handler: fn, origType: type, origHandler: fn, preType: preType } );
      -				});
      -
      -			} else {
      -				// unbind live handler
      -				context.unbind( liveConvert( type, selector ), fn );
      -			}
      -		}
      -		
      -		return this;
      -	}
      -});
      -
      -function liveHandler( event ) {
      -	var stop, elems = [], selectors = [], args = arguments,
      -		related, match, handleObj, elem, j, i, l, data,
      -		events = jQuery.data( this, "events" );
      -
      -	// Make sure we avoid non-left-click bubbling in Firefox (#3861)
      -	if ( event.liveFired === this || !events || !events.live || event.button && event.type === "click" ) {
      -		return;
      -	}
      -
      -	event.liveFired = this;
      -
      -	var live = events.live.slice(0);
      -
      -	for ( j = 0; j < live.length; j++ ) {
      -		handleObj = live[j];
      -
      -		if ( handleObj.origType.replace( rnamespaces, "" ) === event.type ) {
      -			selectors.push( handleObj.selector );
      -
      -		} else {
      -			live.splice( j--, 1 );
      -		}
      -	}
      -
      -	match = jQuery( event.target ).closest( selectors, event.currentTarget );
      -
      -	for ( i = 0, l = match.length; i < l; i++ ) {
      -		for ( j = 0; j < live.length; j++ ) {
      -			handleObj = live[j];
      -
      -			if ( match[i].selector === handleObj.selector ) {
      -				elem = match[i].elem;
      -				related = null;
      -
      -				// Those two events require additional checking
      -				if ( handleObj.preType === "mouseenter" || handleObj.preType === "mouseleave" ) {
      -					related = jQuery( event.relatedTarget ).closest( handleObj.selector )[0];
      -				}
      -
      -				if ( !related || related !== elem ) {
      -					elems.push({ elem: elem, handleObj: handleObj });
      -				}
      -			}
      -		}
      -	}
      -
      -	for ( i = 0, l = elems.length; i < l; i++ ) {
      -		match = elems[i];
      -		event.currentTarget = match.elem;
      -		event.data = match.handleObj.data;
      -		event.handleObj = match.handleObj;
      -
      -		if ( match.handleObj.origHandler.apply( match.elem, args ) === false ) {
      -			stop = false;
      -			break;
      -		}
      -	}
      -
      -	return stop;
      -}
      -
      -function liveConvert( type, selector ) {
      -	return "live." + (type && type !== "*" ? type + "." : "") + selector.replace(/\./g, "`").replace(/ /g, "&");
      -}
      -
      -jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " +
      -	"mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +
      -	"change select submit keydown keypress keyup error").split(" "), function( i, name ) {
      -
      -	// Handle event binding
      -	jQuery.fn[ name ] = function( fn ) {
      -		return fn ? this.bind( name, fn ) : this.trigger( name );
      -	};
      -
      -	if ( jQuery.attrFn ) {
      -		jQuery.attrFn[ name ] = true;
      -	}
      -});
      -
      -// Prevent memory leaks in IE
      -// Window isn't included so as not to unbind existing unload events
      -// More info:
      -//  - http://isaacschlueter.com/2006/10/msie-memory-leaks/
      -if ( window.attachEvent && !window.addEventListener ) {
      -	window.attachEvent("onunload", function() {
      -		for ( var id in jQuery.cache ) {
      -			if ( jQuery.cache[ id ].handle ) {
      -				// Try/Catch is to handle iframes being unloaded, see #4280
      -				try {
      -					jQuery.event.remove( jQuery.cache[ id ].handle.elem );
      -				} catch(e) {}
      -			}
      -		}
      -	});
      -}
      -/*!
      - * Sizzle CSS Selector Engine - v1.0
      - *  Copyright 2009, The Dojo Foundation
      - *  Released under the MIT, BSD, and GPL Licenses.
      - *  More information: http://sizzlejs.com/
      - */
      -(function(){
      -
      -var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,
      -	done = 0,
      -	toString = Object.prototype.toString,
      -	hasDuplicate = false,
      -	baseHasDuplicate = true;
      -
      -// Here we check if the JavaScript engine is using some sort of
      -// optimization where it does not always call our comparision
      -// function. If that is the case, discard the hasDuplicate value.
      -//   Thus far that includes Google Chrome.
      -[0, 0].sort(function(){
      -	baseHasDuplicate = false;
      -	return 0;
      -});
      -
      -var Sizzle = function(selector, context, results, seed) {
      -	results = results || [];
      -	var origContext = context = context || document;
      -
      -	if ( context.nodeType !== 1 && context.nodeType !== 9 ) {
      -		return [];
      -	}
      -	
      -	if ( !selector || typeof selector !== "string" ) {
      -		return results;
      -	}
      -
      -	var parts = [], m, set, checkSet, extra, prune = true, contextXML = isXML(context),
      -		soFar = selector;
      -	
      -	// Reset the position of the chunker regexp (start from head)
      -	while ( (chunker.exec(""), m = chunker.exec(soFar)) !== null ) {
      -		soFar = m[3];
      -		
      -		parts.push( m[1] );
      -		
      -		if ( m[2] ) {
      -			extra = m[3];
      -			break;
      -		}
      -	}
      -
      -	if ( parts.length > 1 && origPOS.exec( selector ) ) {
      -		if ( parts.length === 2 && Expr.relative[ parts[0] ] ) {
      -			set = posProcess( parts[0] + parts[1], context );
      -		} else {
      -			set = Expr.relative[ parts[0] ] ?
      -				[ context ] :
      -				Sizzle( parts.shift(), context );
      -
      -			while ( parts.length ) {
      -				selector = parts.shift();
      -
      -				if ( Expr.relative[ selector ] ) {
      -					selector += parts.shift();
      -				}
      -				
      -				set = posProcess( selector, set );
      -			}
      -		}
      -	} else {
      -		// Take a shortcut and set the context if the root selector is an ID
      -		// (but not if it'll be faster if the inner selector is an ID)
      -		if ( !seed && parts.length > 1 && context.nodeType === 9 && !contextXML &&
      -				Expr.match.ID.test(parts[0]) && !Expr.match.ID.test(parts[parts.length - 1]) ) {
      -			var ret = Sizzle.find( parts.shift(), context, contextXML );
      -			context = ret.expr ? Sizzle.filter( ret.expr, ret.set )[0] : ret.set[0];
      -		}
      -
      -		if ( context ) {
      -			var ret = seed ?
      -				{ expr: parts.pop(), set: makeArray(seed) } :
      -				Sizzle.find( parts.pop(), parts.length === 1 && (parts[0] === "~" || parts[0] === "+") && context.parentNode ? context.parentNode : context, contextXML );
      -			set = ret.expr ? Sizzle.filter( ret.expr, ret.set ) : ret.set;
      -
      -			if ( parts.length > 0 ) {
      -				checkSet = makeArray(set);
      -			} else {
      -				prune = false;
      -			}
      -
      -			while ( parts.length ) {
      -				var cur = parts.pop(), pop = cur;
      -
      -				if ( !Expr.relative[ cur ] ) {
      -					cur = "";
      -				} else {
      -					pop = parts.pop();
      -				}
      -
      -				if ( pop == null ) {
      -					pop = context;
      -				}
      -
      -				Expr.relative[ cur ]( checkSet, pop, contextXML );
      -			}
      -		} else {
      -			checkSet = parts = [];
      -		}
      -	}
      -
      -	if ( !checkSet ) {
      -		checkSet = set;
      -	}
      -
      -	if ( !checkSet ) {
      -		Sizzle.error( cur || selector );
      -	}
      -
      -	if ( toString.call(checkSet) === "[object Array]" ) {
      -		if ( !prune ) {
      -			results.push.apply( results, checkSet );
      -		} else if ( context && context.nodeType === 1 ) {
      -			for ( var i = 0; checkSet[i] != null; i++ ) {
      -				if ( checkSet[i] && (checkSet[i] === true || checkSet[i].nodeType === 1 && contains(context, checkSet[i])) ) {
      -					results.push( set[i] );
      -				}
      -			}
      -		} else {
      -			for ( var i = 0; checkSet[i] != null; i++ ) {
      -				if ( checkSet[i] && checkSet[i].nodeType === 1 ) {
      -					results.push( set[i] );
      -				}
      -			}
      -		}
      -	} else {
      -		makeArray( checkSet, results );
      -	}
      -
      -	if ( extra ) {
      -		Sizzle( extra, origContext, results, seed );
      -		Sizzle.uniqueSort( results );
      -	}
      -
      -	return results;
      -};
      -
      -Sizzle.uniqueSort = function(results){
      -	if ( sortOrder ) {
      -		hasDuplicate = baseHasDuplicate;
      -		results.sort(sortOrder);
      -
      -		if ( hasDuplicate ) {
      -			for ( var i = 1; i < results.length; i++ ) {
      -				if ( results[i] === results[i-1] ) {
      -					results.splice(i--, 1);
      -				}
      -			}
      -		}
      -	}
      -
      -	return results;
      -};
      -
      -Sizzle.matches = function(expr, set){
      -	return Sizzle(expr, null, null, set);
      -};
      -
      -Sizzle.find = function(expr, context, isXML){
      -	var set, match;
      -
      -	if ( !expr ) {
      -		return [];
      -	}
      -
      -	for ( var i = 0, l = Expr.order.length; i < l; i++ ) {
      -		var type = Expr.order[i], match;
      -		
      -		if ( (match = Expr.leftMatch[ type ].exec( expr )) ) {
      -			var left = match[1];
      -			match.splice(1,1);
      -
      -			if ( left.substr( left.length - 1 ) !== "\\" ) {
      -				match[1] = (match[1] || "").replace(/\\/g, "");
      -				set = Expr.find[ type ]( match, context, isXML );
      -				if ( set != null ) {
      -					expr = expr.replace( Expr.match[ type ], "" );
      -					break;
      -				}
      -			}
      -		}
      -	}
      -
      -	if ( !set ) {
      -		set = context.getElementsByTagName("*");
      -	}
      -
      -	return {set: set, expr: expr};
      -};
      -
      -Sizzle.filter = function(expr, set, inplace, not){
      -	var old = expr, result = [], curLoop = set, match, anyFound,
      -		isXMLFilter = set && set[0] && isXML(set[0]);
      -
      -	while ( expr && set.length ) {
      -		for ( var type in Expr.filter ) {
      -			if ( (match = Expr.leftMatch[ type ].exec( expr )) != null && match[2] ) {
      -				var filter = Expr.filter[ type ], found, item, left = match[1];
      -				anyFound = false;
      -
      -				match.splice(1,1);
      -
      -				if ( left.substr( left.length - 1 ) === "\\" ) {
      -					continue;
      -				}
      -
      -				if ( curLoop === result ) {
      -					result = [];
      -				}
      -
      -				if ( Expr.preFilter[ type ] ) {
      -					match = Expr.preFilter[ type ]( match, curLoop, inplace, result, not, isXMLFilter );
      -
      -					if ( !match ) {
      -						anyFound = found = true;
      -					} else if ( match === true ) {
      -						continue;
      -					}
      -				}
      -
      -				if ( match ) {
      -					for ( var i = 0; (item = curLoop[i]) != null; i++ ) {
      -						if ( item ) {
      -							found = filter( item, match, i, curLoop );
      -							var pass = not ^ !!found;
      -
      -							if ( inplace && found != null ) {
      -								if ( pass ) {
      -									anyFound = true;
      -								} else {
      -									curLoop[i] = false;
      -								}
      -							} else if ( pass ) {
      -								result.push( item );
      -								anyFound = true;
      -							}
      -						}
      -					}
      -				}
      -
      -				if ( found !== undefined ) {
      -					if ( !inplace ) {
      -						curLoop = result;
      -					}
      -
      -					expr = expr.replace( Expr.match[ type ], "" );
      -
      -					if ( !anyFound ) {
      -						return [];
      -					}
      -
      -					break;
      -				}
      -			}
      -		}
      -
      -		// Improper expression
      -		if ( expr === old ) {
      -			if ( anyFound == null ) {
      -				Sizzle.error( expr );
      -			} else {
      -				break;
      -			}
      -		}
      -
      -		old = expr;
      -	}
      -
      -	return curLoop;
      -};
      -
      -Sizzle.error = function( msg ) {
      -	throw "Syntax error, unrecognized expression: " + msg;
      -};
      -
      -var Expr = Sizzle.selectors = {
      -	order: [ "ID", "NAME", "TAG" ],
      -	match: {
      -		ID: /#((?:[\w\u00c0-\uFFFF-]|\\.)+)/,
      -		CLASS: /\.((?:[\w\u00c0-\uFFFF-]|\\.)+)/,
      -		NAME: /\[name=['"]*((?:[\w\u00c0-\uFFFF-]|\\.)+)['"]*\]/,
      -		ATTR: /\[\s*((?:[\w\u00c0-\uFFFF-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,
      -		TAG: /^((?:[\w\u00c0-\uFFFF\*-]|\\.)+)/,
      -		CHILD: /:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,
      -		POS: /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,
      -		PSEUDO: /:((?:[\w\u00c0-\uFFFF-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/
      -	},
      -	leftMatch: {},
      -	attrMap: {
      -		"class": "className",
      -		"for": "htmlFor"
      -	},
      -	attrHandle: {
      -		href: function(elem){
      -			return elem.getAttribute("href");
      -		}
      -	},
      -	relative: {
      -		"+": function(checkSet, part){
      -			var isPartStr = typeof part === "string",
      -				isTag = isPartStr && !/\W/.test(part),
      -				isPartStrNotTag = isPartStr && !isTag;
      -
      -			if ( isTag ) {
      -				part = part.toLowerCase();
      -			}
      -
      -			for ( var i = 0, l = checkSet.length, elem; i < l; i++ ) {
      -				if ( (elem = checkSet[i]) ) {
      -					while ( (elem = elem.previousSibling) && elem.nodeType !== 1 ) {}
      -
      -					checkSet[i] = isPartStrNotTag || elem && elem.nodeName.toLowerCase() === part ?
      -						elem || false :
      -						elem === part;
      -				}
      -			}
      -
      -			if ( isPartStrNotTag ) {
      -				Sizzle.filter( part, checkSet, true );
      -			}
      -		},
      -		">": function(checkSet, part){
      -			var isPartStr = typeof part === "string";
      -
      -			if ( isPartStr && !/\W/.test(part) ) {
      -				part = part.toLowerCase();
      -
      -				for ( var i = 0, l = checkSet.length; i < l; i++ ) {
      -					var elem = checkSet[i];
      -					if ( elem ) {
      -						var parent = elem.parentNode;
      -						checkSet[i] = parent.nodeName.toLowerCase() === part ? parent : false;
      -					}
      -				}
      -			} else {
      -				for ( var i = 0, l = checkSet.length; i < l; i++ ) {
      -					var elem = checkSet[i];
      -					if ( elem ) {
      -						checkSet[i] = isPartStr ?
      -							elem.parentNode :
      -							elem.parentNode === part;
      -					}
      -				}
      -
      -				if ( isPartStr ) {
      -					Sizzle.filter( part, checkSet, true );
      -				}
      -			}
      -		},
      -		"": function(checkSet, part, isXML){
      -			var doneName = done++, checkFn = dirCheck;
      -
      -			if ( typeof part === "string" && !/\W/.test(part) ) {
      -				var nodeCheck = part = part.toLowerCase();
      -				checkFn = dirNodeCheck;
      -			}
      -
      -			checkFn("parentNode", part, doneName, checkSet, nodeCheck, isXML);
      -		},
      -		"~": function(checkSet, part, isXML){
      -			var doneName = done++, checkFn = dirCheck;
      -
      -			if ( typeof part === "string" && !/\W/.test(part) ) {
      -				var nodeCheck = part = part.toLowerCase();
      -				checkFn = dirNodeCheck;
      -			}
      -
      -			checkFn("previousSibling", part, doneName, checkSet, nodeCheck, isXML);
      -		}
      -	},
      -	find: {
      -		ID: function(match, context, isXML){
      -			if ( typeof context.getElementById !== "undefined" && !isXML ) {
      -				var m = context.getElementById(match[1]);
      -				return m ? [m] : [];
      -			}
      -		},
      -		NAME: function(match, context){
      -			if ( typeof context.getElementsByName !== "undefined" ) {
      -				var ret = [], results = context.getElementsByName(match[1]);
      -
      -				for ( var i = 0, l = results.length; i < l; i++ ) {
      -					if ( results[i].getAttribute("name") === match[1] ) {
      -						ret.push( results[i] );
      -					}
      -				}
      -
      -				return ret.length === 0 ? null : ret;
      -			}
      -		},
      -		TAG: function(match, context){
      -			return context.getElementsByTagName(match[1]);
      -		}
      -	},
      -	preFilter: {
      -		CLASS: function(match, curLoop, inplace, result, not, isXML){
      -			match = " " + match[1].replace(/\\/g, "") + " ";
      -
      -			if ( isXML ) {
      -				return match;
      -			}
      -
      -			for ( var i = 0, elem; (elem = curLoop[i]) != null; i++ ) {
      -				if ( elem ) {
      -					if ( not ^ (elem.className && (" " + elem.className + " ").replace(/[\t\n]/g, " ").indexOf(match) >= 0) ) {
      -						if ( !inplace ) {
      -							result.push( elem );
      -						}
      -					} else if ( inplace ) {
      -						curLoop[i] = false;
      -					}
      -				}
      -			}
      -
      -			return false;
      -		},
      -		ID: function(match){
      -			return match[1].replace(/\\/g, "");
      -		},
      -		TAG: function(match, curLoop){
      -			return match[1].toLowerCase();
      -		},
      -		CHILD: function(match){
      -			if ( match[1] === "nth" ) {
      -				// parse equations like 'even', 'odd', '5', '2n', '3n+2', '4n-1', '-n+6'
      -				var test = /(-?)(\d*)n((?:\+|-)?\d*)/.exec(
      -					match[2] === "even" && "2n" || match[2] === "odd" && "2n+1" ||
      -					!/\D/.test( match[2] ) && "0n+" + match[2] || match[2]);
      -
      -				// calculate the numbers (first)n+(last) including if they are negative
      -				match[2] = (test[1] + (test[2] || 1)) - 0;
      -				match[3] = test[3] - 0;
      -			}
      -
      -			// TODO: Move to normal caching system
      -			match[0] = done++;
      -
      -			return match;
      -		},
      -		ATTR: function(match, curLoop, inplace, result, not, isXML){
      -			var name = match[1].replace(/\\/g, "");
      -			
      -			if ( !isXML && Expr.attrMap[name] ) {
      -				match[1] = Expr.attrMap[name];
      -			}
      -
      -			if ( match[2] === "~=" ) {
      -				match[4] = " " + match[4] + " ";
      -			}
      -
      -			return match;
      -		},
      -		PSEUDO: function(match, curLoop, inplace, result, not){
      -			if ( match[1] === "not" ) {
      -				// If we're dealing with a complex expression, or a simple one
      -				if ( ( chunker.exec(match[3]) || "" ).length > 1 || /^\w/.test(match[3]) ) {
      -					match[3] = Sizzle(match[3], null, null, curLoop);
      -				} else {
      -					var ret = Sizzle.filter(match[3], curLoop, inplace, true ^ not);
      -					if ( !inplace ) {
      -						result.push.apply( result, ret );
      -					}
      -					return false;
      -				}
      -			} else if ( Expr.match.POS.test( match[0] ) || Expr.match.CHILD.test( match[0] ) ) {
      -				return true;
      -			}
      -			
      -			return match;
      -		},
      -		POS: function(match){
      -			match.unshift( true );
      -			return match;
      -		}
      -	},
      -	filters: {
      -		enabled: function(elem){
      -			return elem.disabled === false && elem.type !== "hidden";
      -		},
      -		disabled: function(elem){
      -			return elem.disabled === true;
      -		},
      -		checked: function(elem){
      -			return elem.checked === true;
      -		},
      -		selected: function(elem){
      -			// Accessing this property makes selected-by-default
      -			// options in Safari work properly
      -			elem.parentNode.selectedIndex;
      -			return elem.selected === true;
      -		},
      -		parent: function(elem){
      -			return !!elem.firstChild;
      -		},
      -		empty: function(elem){
      -			return !elem.firstChild;
      -		},
      -		has: function(elem, i, match){
      -			return !!Sizzle( match[3], elem ).length;
      -		},
      -		header: function(elem){
      -			return /h\d/i.test( elem.nodeName );
      -		},
      -		text: function(elem){
      -			return "text" === elem.type;
      -		},
      -		radio: function(elem){
      -			return "radio" === elem.type;
      -		},
      -		checkbox: function(elem){
      -			return "checkbox" === elem.type;
      -		},
      -		file: function(elem){
      -			return "file" === elem.type;
      -		},
      -		password: function(elem){
      -			return "password" === elem.type;
      -		},
      -		submit: function(elem){
      -			return "submit" === elem.type;
      -		},
      -		image: function(elem){
      -			return "image" === elem.type;
      -		},
      -		reset: function(elem){
      -			return "reset" === elem.type;
      -		},
      -		button: function(elem){
      -			return "button" === elem.type || elem.nodeName.toLowerCase() === "button";
      -		},
      -		input: function(elem){
      -			return /input|select|textarea|button/i.test(elem.nodeName);
      -		}
      -	},
      -	setFilters: {
      -		first: function(elem, i){
      -			return i === 0;
      -		},
      -		last: function(elem, i, match, array){
      -			return i === array.length - 1;
      -		},
      -		even: function(elem, i){
      -			return i % 2 === 0;
      -		},
      -		odd: function(elem, i){
      -			return i % 2 === 1;
      -		},
      -		lt: function(elem, i, match){
      -			return i < match[3] - 0;
      -		},
      -		gt: function(elem, i, match){
      -			return i > match[3] - 0;
      -		},
      -		nth: function(elem, i, match){
      -			return match[3] - 0 === i;
      -		},
      -		eq: function(elem, i, match){
      -			return match[3] - 0 === i;
      -		}
      -	},
      -	filter: {
      -		PSEUDO: function(elem, match, i, array){
      -			var name = match[1], filter = Expr.filters[ name ];
      -
      -			if ( filter ) {
      -				return filter( elem, i, match, array );
      -			} else if ( name === "contains" ) {
      -				return (elem.textContent || elem.innerText || getText([ elem ]) || "").indexOf(match[3]) >= 0;
      -			} else if ( name === "not" ) {
      -				var not = match[3];
      -
      -				for ( var i = 0, l = not.length; i < l; i++ ) {
      -					if ( not[i] === elem ) {
      -						return false;
      -					}
      -				}
      -
      -				return true;
      -			} else {
      -				Sizzle.error( "Syntax error, unrecognized expression: " + name );
      -			}
      -		},
      -		CHILD: function(elem, match){
      -			var type = match[1], node = elem;
      -			switch (type) {
      -				case 'only':
      -				case 'first':
      -					while ( (node = node.previousSibling) )	 {
      -						if ( node.nodeType === 1 ) { 
      -							return false; 
      -						}
      -					}
      -					if ( type === "first" ) { 
      -						return true; 
      -					}
      -					node = elem;
      -				case 'last':
      -					while ( (node = node.nextSibling) )	 {
      -						if ( node.nodeType === 1 ) { 
      -							return false; 
      -						}
      -					}
      -					return true;
      -				case 'nth':
      -					var first = match[2], last = match[3];
      -
      -					if ( first === 1 && last === 0 ) {
      -						return true;
      -					}
      -					
      -					var doneName = match[0],
      -						parent = elem.parentNode;
      -	
      -					if ( parent && (parent.sizcache !== doneName || !elem.nodeIndex) ) {
      -						var count = 0;
      -						for ( node = parent.firstChild; node; node = node.nextSibling ) {
      -							if ( node.nodeType === 1 ) {
      -								node.nodeIndex = ++count;
      -							}
      -						} 
      -						parent.sizcache = doneName;
      -					}
      -					
      -					var diff = elem.nodeIndex - last;
      -					if ( first === 0 ) {
      -						return diff === 0;
      -					} else {
      -						return ( diff % first === 0 && diff / first >= 0 );
      -					}
      -			}
      -		},
      -		ID: function(elem, match){
      -			return elem.nodeType === 1 && elem.getAttribute("id") === match;
      -		},
      -		TAG: function(elem, match){
      -			return (match === "*" && elem.nodeType === 1) || elem.nodeName.toLowerCase() === match;
      -		},
      -		CLASS: function(elem, match){
      -			return (" " + (elem.className || elem.getAttribute("class")) + " ")
      -				.indexOf( match ) > -1;
      -		},
      -		ATTR: function(elem, match){
      -			var name = match[1],
      -				result = Expr.attrHandle[ name ] ?
      -					Expr.attrHandle[ name ]( elem ) :
      -					elem[ name ] != null ?
      -						elem[ name ] :
      -						elem.getAttribute( name ),
      -				value = result + "",
      -				type = match[2],
      -				check = match[4];
      -
      -			return result == null ?
      -				type === "!=" :
      -				type === "=" ?
      -				value === check :
      -				type === "*=" ?
      -				value.indexOf(check) >= 0 :
      -				type === "~=" ?
      -				(" " + value + " ").indexOf(check) >= 0 :
      -				!check ?
      -				value && result !== false :
      -				type === "!=" ?
      -				value !== check :
      -				type === "^=" ?
      -				value.indexOf(check) === 0 :
      -				type === "$=" ?
      -				value.substr(value.length - check.length) === check :
      -				type === "|=" ?
      -				value === check || value.substr(0, check.length + 1) === check + "-" :
      -				false;
      -		},
      -		POS: function(elem, match, i, array){
      -			var name = match[2], filter = Expr.setFilters[ name ];
      -
      -			if ( filter ) {
      -				return filter( elem, i, match, array );
      -			}
      -		}
      -	}
      -};
      -
      -var origPOS = Expr.match.POS;
      -
      -for ( var type in Expr.match ) {
      -	Expr.match[ type ] = new RegExp( Expr.match[ type ].source + /(?![^\[]*\])(?![^\(]*\))/.source );
      -	Expr.leftMatch[ type ] = new RegExp( /(^(?:.|\r|\n)*?)/.source + Expr.match[ type ].source.replace(/\\(\d+)/g, function(all, num){
      -		return "\\" + (num - 0 + 1);
      -	}));
      -}
      -
      -var makeArray = function(array, results) {
      -	array = Array.prototype.slice.call( array, 0 );
      -
      -	if ( results ) {
      -		results.push.apply( results, array );
      -		return results;
      -	}
      -	
      -	return array;
      -};
      -
      -// Perform a simple check to determine if the browser is capable of
      -// converting a NodeList to an array using builtin methods.
      -// Also verifies that the returned array holds DOM nodes
      -// (which is not the case in the Blackberry browser)
      -try {
      -	Array.prototype.slice.call( document.documentElement.childNodes, 0 )[0].nodeType;
      -
      -// Provide a fallback method if it does not work
      -} catch(e){
      -	makeArray = function(array, results) {
      -		var ret = results || [];
      -
      -		if ( toString.call(array) === "[object Array]" ) {
      -			Array.prototype.push.apply( ret, array );
      -		} else {
      -			if ( typeof array.length === "number" ) {
      -				for ( var i = 0, l = array.length; i < l; i++ ) {
      -					ret.push( array[i] );
      -				}
      -			} else {
      -				for ( var i = 0; array[i]; i++ ) {
      -					ret.push( array[i] );
      -				}
      -			}
      -		}
      -
      -		return ret;
      -	};
      -}
      -
      -var sortOrder;
      -
      -if ( document.documentElement.compareDocumentPosition ) {
      -	sortOrder = function( a, b ) {
      -		if ( !a.compareDocumentPosition || !b.compareDocumentPosition ) {
      -			if ( a == b ) {
      -				hasDuplicate = true;
      -			}
      -			return a.compareDocumentPosition ? -1 : 1;
      -		}
      -
      -		var ret = a.compareDocumentPosition(b) & 4 ? -1 : a === b ? 0 : 1;
      -		if ( ret === 0 ) {
      -			hasDuplicate = true;
      -		}
      -		return ret;
      -	};
      -} else if ( "sourceIndex" in document.documentElement ) {
      -	sortOrder = function( a, b ) {
      -		if ( !a.sourceIndex || !b.sourceIndex ) {
      -			if ( a == b ) {
      -				hasDuplicate = true;
      -			}
      -			return a.sourceIndex ? -1 : 1;
      -		}
      -
      -		var ret = a.sourceIndex - b.sourceIndex;
      -		if ( ret === 0 ) {
      -			hasDuplicate = true;
      -		}
      -		return ret;
      -	};
      -} else if ( document.createRange ) {
      -	sortOrder = function( a, b ) {
      -		if ( !a.ownerDocument || !b.ownerDocument ) {
      -			if ( a == b ) {
      -				hasDuplicate = true;
      -			}
      -			return a.ownerDocument ? -1 : 1;
      -		}
      -
      -		var aRange = a.ownerDocument.createRange(), bRange = b.ownerDocument.createRange();
      -		aRange.setStart(a, 0);
      -		aRange.setEnd(a, 0);
      -		bRange.setStart(b, 0);
      -		bRange.setEnd(b, 0);
      -		var ret = aRange.compareBoundaryPoints(Range.START_TO_END, bRange);
      -		if ( ret === 0 ) {
      -			hasDuplicate = true;
      -		}
      -		return ret;
      -	};
      -}
      -
      -// Utility function for retreiving the text value of an array of DOM nodes
      -function getText( elems ) {
      -	var ret = "", elem;
      -
      -	for ( var i = 0; elems[i]; i++ ) {
      -		elem = elems[i];
      -
      -		// Get the text from text nodes and CDATA nodes
      -		if ( elem.nodeType === 3 || elem.nodeType === 4 ) {
      -			ret += elem.nodeValue;
      -
      -		// Traverse everything else, except comment nodes
      -		} else if ( elem.nodeType !== 8 ) {
      -			ret += getText( elem.childNodes );
      -		}
      -	}
      -
      -	return ret;
      -}
      -
      -// Check to see if the browser returns elements by name when
      -// querying by getElementById (and provide a workaround)
      -(function(){
      -	// We're going to inject a fake input element with a specified name
      -	var form = document.createElement("div"),
      -		id = "script" + (new Date).getTime();
      -	form.innerHTML = "<a name='" + id + "'/>";
      -
      -	// Inject it into the root element, check its status, and remove it quickly
      -	var root = document.documentElement;
      -	root.insertBefore( form, root.firstChild );
      -
      -	// The workaround has to do additional checks after a getElementById
      -	// Which slows things down for other browsers (hence the branching)
      -	if ( document.getElementById( id ) ) {
      -		Expr.find.ID = function(match, context, isXML){
      -			if ( typeof context.getElementById !== "undefined" && !isXML ) {
      -				var m = context.getElementById(match[1]);
      -				return m ? m.id === match[1] || typeof m.getAttributeNode !== "undefined" && m.getAttributeNode("id").nodeValue === match[1] ? [m] : undefined : [];
      -			}
      -		};
      -
      -		Expr.filter.ID = function(elem, match){
      -			var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id");
      -			return elem.nodeType === 1 && node && node.nodeValue === match;
      -		};
      -	}
      -
      -	root.removeChild( form );
      -	root = form = null; // release memory in IE
      -})();
      -
      -(function(){
      -	// Check to see if the browser returns only elements
      -	// when doing getElementsByTagName("*")
      -
      -	// Create a fake element
      -	var div = document.createElement("div");
      -	div.appendChild( document.createComment("") );
      -
      -	// Make sure no comments are found
      -	if ( div.getElementsByTagName("*").length > 0 ) {
      -		Expr.find.TAG = function(match, context){
      -			var results = context.getElementsByTagName(match[1]);
      -
      -			// Filter out possible comments
      -			if ( match[1] === "*" ) {
      -				var tmp = [];
      -
      -				for ( var i = 0; results[i]; i++ ) {
      -					if ( results[i].nodeType === 1 ) {
      -						tmp.push( results[i] );
      -					}
      -				}
      -
      -				results = tmp;
      -			}
      -
      -			return results;
      -		};
      -	}
      -
      -	// Check to see if an attribute returns normalized href attributes
      -	div.innerHTML = "<a href='#'></a>";
      -	if ( div.firstChild && typeof div.firstChild.getAttribute !== "undefined" &&
      -			div.firstChild.getAttribute("href") !== "#" ) {
      -		Expr.attrHandle.href = function(elem){
      -			return elem.getAttribute("href", 2);
      -		};
      -	}
      -
      -	div = null; // release memory in IE
      -})();
      -
      -if ( document.querySelectorAll ) {
      -	(function(){
      -		var oldSizzle = Sizzle, div = document.createElement("div");
      -		div.innerHTML = "<p class='TEST'></p>";
      -
      -		// Safari can't handle uppercase or unicode characters when
      -		// in quirks mode.
      -		if ( div.querySelectorAll && div.querySelectorAll(".TEST").length === 0 ) {
      -			return;
      -		}
      -	
      -		Sizzle = function(query, context, extra, seed){
      -			context = context || document;
      -
      -			// Only use querySelectorAll on non-XML documents
      -			// (ID selectors don't work in non-HTML documents)
      -			if ( !seed && context.nodeType === 9 && !isXML(context) ) {
      -				try {
      -					return makeArray( context.querySelectorAll(query), extra );
      -				} catch(e){}
      -			}
      -		
      -			return oldSizzle(query, context, extra, seed);
      -		};
      -
      -		for ( var prop in oldSizzle ) {
      -			Sizzle[ prop ] = oldSizzle[ prop ];
      -		}
      -
      -		div = null; // release memory in IE
      -	})();
      -}
      -
      -(function(){
      -	var div = document.createElement("div");
      -
      -	div.innerHTML = "<div class='test e'></div><div class='test'></div>";
      -
      -	// Opera can't find a second classname (in 9.6)
      -	// Also, make sure that getElementsByClassName actually exists
      -	if ( !div.getElementsByClassName || div.getElementsByClassName("e").length === 0 ) {
      -		return;
      -	}
      -
      -	// Safari caches class attributes, doesn't catch changes (in 3.2)
      -	div.lastChild.className = "e";
      -
      -	if ( div.getElementsByClassName("e").length === 1 ) {
      -		return;
      -	}
      -	
      -	Expr.order.splice(1, 0, "CLASS");
      -	Expr.find.CLASS = function(match, context, isXML) {
      -		if ( typeof context.getElementsByClassName !== "undefined" && !isXML ) {
      -			return context.getElementsByClassName(match[1]);
      -		}
      -	};
      -
      -	div = null; // release memory in IE
      -})();
      -
      -function dirNodeCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
      -	for ( var i = 0, l = checkSet.length; i < l; i++ ) {
      -		var elem = checkSet[i];
      -		if ( elem ) {
      -			elem = elem[dir];
      -			var match = false;
      -
      -			while ( elem ) {
      -				if ( elem.sizcache === doneName ) {
      -					match = checkSet[elem.sizset];
      -					break;
      -				}
      -
      -				if ( elem.nodeType === 1 && !isXML ){
      -					elem.sizcache = doneName;
      -					elem.sizset = i;
      -				}
      -
      -				if ( elem.nodeName.toLowerCase() === cur ) {
      -					match = elem;
      -					break;
      -				}
      -
      -				elem = elem[dir];
      -			}
      -
      -			checkSet[i] = match;
      -		}
      -	}
      -}
      -
      -function dirCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
      -	for ( var i = 0, l = checkSet.length; i < l; i++ ) {
      -		var elem = checkSet[i];
      -		if ( elem ) {
      -			elem = elem[dir];
      -			var match = false;
      -
      -			while ( elem ) {
      -				if ( elem.sizcache === doneName ) {
      -					match = checkSet[elem.sizset];
      -					break;
      -				}
      -
      -				if ( elem.nodeType === 1 ) {
      -					if ( !isXML ) {
      -						elem.sizcache = doneName;
      -						elem.sizset = i;
      -					}
      -					if ( typeof cur !== "string" ) {
      -						if ( elem === cur ) {
      -							match = true;
      -							break;
      -						}
      -
      -					} else if ( Sizzle.filter( cur, [elem] ).length > 0 ) {
      -						match = elem;
      -						break;
      -					}
      -				}
      -
      -				elem = elem[dir];
      -			}
      -
      -			checkSet[i] = match;
      -		}
      -	}
      -}
      -
      -var contains = document.compareDocumentPosition ? function(a, b){
      -	return !!(a.compareDocumentPosition(b) & 16);
      -} : function(a, b){
      -	return a !== b && (a.contains ? a.contains(b) : true);
      -};
      -
      -var isXML = function(elem){
      -	// documentElement is verified for cases where it doesn't yet exist
      -	// (such as loading iframes in IE - #4833) 
      -	var documentElement = (elem ? elem.ownerDocument || elem : 0).documentElement;
      -	return documentElement ? documentElement.nodeName !== "HTML" : false;
      -};
      -
      -var posProcess = function(selector, context){
      -	var tmpSet = [], later = "", match,
      -		root = context.nodeType ? [context] : context;
      -
      -	// Position selectors must be done after the filter
      -	// And so must :not(positional) so we move all PSEUDOs to the end
      -	while ( (match = Expr.match.PSEUDO.exec( selector )) ) {
      -		later += match[0];
      -		selector = selector.replace( Expr.match.PSEUDO, "" );
      -	}
      -
      -	selector = Expr.relative[selector] ? selector + "*" : selector;
      -
      -	for ( var i = 0, l = root.length; i < l; i++ ) {
      -		Sizzle( selector, root[i], tmpSet );
      -	}
      -
      -	return Sizzle.filter( later, tmpSet );
      -};
      -
      -// EXPOSE
      -jQuery.find = Sizzle;
      -jQuery.expr = Sizzle.selectors;
      -jQuery.expr[":"] = jQuery.expr.filters;
      -jQuery.unique = Sizzle.uniqueSort;
      -jQuery.text = getText;
      -jQuery.isXMLDoc = isXML;
      -jQuery.contains = contains;
      -
      -return;
      -
      -window.Sizzle = Sizzle;
      -
      -})();
      -var runtil = /Until$/,
      -	rparentsprev = /^(?:parents|prevUntil|prevAll)/,
      -	// Note: This RegExp should be improved, or likely pulled from Sizzle
      -	rmultiselector = /,/,
      -	slice = Array.prototype.slice;
      -
      -// Implement the identical functionality for filter and not
      -var winnow = function( elements, qualifier, keep ) {
      -	if ( jQuery.isFunction( qualifier ) ) {
      -		return jQuery.grep(elements, function( elem, i ) {
      -			return !!qualifier.call( elem, i, elem ) === keep;
      -		});
      -
      -	} else if ( qualifier.nodeType ) {
      -		return jQuery.grep(elements, function( elem, i ) {
      -			return (elem === qualifier) === keep;
      -		});
      -
      -	} else if ( typeof qualifier === "string" ) {
      -		var filtered = jQuery.grep(elements, function( elem ) {
      -			return elem.nodeType === 1;
      -		});
      -
      -		if ( isSimple.test( qualifier ) ) {
      -			return jQuery.filter(qualifier, filtered, !keep);
      -		} else {
      -			qualifier = jQuery.filter( qualifier, filtered );
      -		}
      -	}
      -
      -	return jQuery.grep(elements, function( elem, i ) {
      -		return (jQuery.inArray( elem, qualifier ) >= 0) === keep;
      -	});
      -};
      -
      -jQuery.fn.extend({
      -	find: function( selector ) {
      -		var ret = this.pushStack( "", "find", selector ), length = 0;
      -
      -		for ( var i = 0, l = this.length; i < l; i++ ) {
      -			length = ret.length;
      -			jQuery.find( selector, this[i], ret );
      -
      -			if ( i > 0 ) {
      -				// Make sure that the results are unique
      -				for ( var n = length; n < ret.length; n++ ) {
      -					for ( var r = 0; r < length; r++ ) {
      -						if ( ret[r] === ret[n] ) {
      -							ret.splice(n--, 1);
      -							break;
      -						}
      -					}
      -				}
      -			}
      -		}
      -
      -		return ret;
      -	},
      -
      -	has: function( target ) {
      -		var targets = jQuery( target );
      -		return this.filter(function() {
      -			for ( var i = 0, l = targets.length; i < l; i++ ) {
      -				if ( jQuery.contains( this, targets[i] ) ) {
      -					return true;
      -				}
      -			}
      -		});
      -	},
      -
      -	not: function( selector ) {
      -		return this.pushStack( winnow(this, selector, false), "not", selector);
      -	},
      -
      -	filter: function( selector ) {
      -		return this.pushStack( winnow(this, selector, true), "filter", selector );
      -	},
      -	
      -	is: function( selector ) {
      -		return !!selector && jQuery.filter( selector, this ).length > 0;
      -	},
      -
      -	closest: function( selectors, context ) {
      -		if ( jQuery.isArray( selectors ) ) {
      -			var ret = [], cur = this[0], match, matches = {}, selector;
      -
      -			if ( cur && selectors.length ) {
      -				for ( var i = 0, l = selectors.length; i < l; i++ ) {
      -					selector = selectors[i];
      -
      -					if ( !matches[selector] ) {
      -						matches[selector] = jQuery.expr.match.POS.test( selector ) ? 
      -							jQuery( selector, context || this.context ) :
      -							selector;
      -					}
      -				}
      -
      -				while ( cur && cur.ownerDocument && cur !== context ) {
      -					for ( selector in matches ) {
      -						match = matches[selector];
      -
      -						if ( match.jquery ? match.index(cur) > -1 : jQuery(cur).is(match) ) {
      -							ret.push({ selector: selector, elem: cur });
      -							delete matches[selector];
      -						}
      -					}
      -					cur = cur.parentNode;
      -				}
      -			}
      -
      -			return ret;
      -		}
      -
      -		var pos = jQuery.expr.match.POS.test( selectors ) ? 
      -			jQuery( selectors, context || this.context ) : null;
      -
      -		return this.map(function( i, cur ) {
      -			while ( cur && cur.ownerDocument && cur !== context ) {
      -				if ( pos ? pos.index(cur) > -1 : jQuery(cur).is(selectors) ) {
      -					return cur;
      -				}
      -				cur = cur.parentNode;
      -			}
      -			return null;
      -		});
      -	},
      -	
      -	// Determine the position of an element within
      -	// the matched set of elements
      -	index: function( elem ) {
      -		if ( !elem || typeof elem === "string" ) {
      -			return jQuery.inArray( this[0],
      -				// If it receives a string, the selector is used
      -				// If it receives nothing, the siblings are used
      -				elem ? jQuery( elem ) : this.parent().children() );
      -		}
      -		// Locate the position of the desired element
      -		return jQuery.inArray(
      -			// If it receives a jQuery object, the first element is used
      -			elem.jquery ? elem[0] : elem, this );
      -	},
      -
      -	add: function( selector, context ) {
      -		var set = typeof selector === "string" ?
      -				jQuery( selector, context || this.context ) :
      -				jQuery.makeArray( selector ),
      -			all = jQuery.merge( this.get(), set );
      -
      -		return this.pushStack( isDisconnected( set[0] ) || isDisconnected( all[0] ) ?
      -			all :
      -			jQuery.unique( all ) );
      -	},
      -
      -	andSelf: function() {
      -		return this.add( this.prevObject );
      -	}
      -});
      -
      -// A painfully simple check to see if an element is disconnected
      -// from a document (should be improved, where feasible).
      -function isDisconnected( node ) {
      -	return !node || !node.parentNode || node.parentNode.nodeType === 11;
      -}
      -
      -jQuery.each({
      -	parent: function( elem ) {
      -		var parent = elem.parentNode;
      -		return parent && parent.nodeType !== 11 ? parent : null;
      -	},
      -	parents: function( elem ) {
      -		return jQuery.dir( elem, "parentNode" );
      -	},
      -	parentsUntil: function( elem, i, until ) {
      -		return jQuery.dir( elem, "parentNode", until );
      -	},
      -	next: function( elem ) {
      -		return jQuery.nth( elem, 2, "nextSibling" );
      -	},
      -	prev: function( elem ) {
      -		return jQuery.nth( elem, 2, "previousSibling" );
      -	},
      -	nextAll: function( elem ) {
      -		return jQuery.dir( elem, "nextSibling" );
      -	},
      -	prevAll: function( elem ) {
      -		return jQuery.dir( elem, "previousSibling" );
      -	},
      -	nextUntil: function( elem, i, until ) {
      -		return jQuery.dir( elem, "nextSibling", until );
      -	},
      -	prevUntil: function( elem, i, until ) {
      -		return jQuery.dir( elem, "previousSibling", until );
      -	},
      -	siblings: function( elem ) {
      -		return jQuery.sibling( elem.parentNode.firstChild, elem );
      -	},
      -	children: function( elem ) {
      -		return jQuery.sibling( elem.firstChild );
      -	},
      -	contents: function( elem ) {
      -		return jQuery.nodeName( elem, "iframe" ) ?
      -			elem.contentDocument || elem.contentWindow.document :
      -			jQuery.makeArray( elem.childNodes );
      -	}
      -}, function( name, fn ) {
      -	jQuery.fn[ name ] = function( until, selector ) {
      -		var ret = jQuery.map( this, fn, until );
      -		
      -		if ( !runtil.test( name ) ) {
      -			selector = until;
      -		}
      -
      -		if ( selector && typeof selector === "string" ) {
      -			ret = jQuery.filter( selector, ret );
      -		}
      -
      -		ret = this.length > 1 ? jQuery.unique( ret ) : ret;
      -
      -		if ( (this.length > 1 || rmultiselector.test( selector )) && rparentsprev.test( name ) ) {
      -			ret = ret.reverse();
      -		}
      -
      -		return this.pushStack( ret, name, slice.call(arguments).join(",") );
      -	};
      -});
      -
      -jQuery.extend({
      -	filter: function( expr, elems, not ) {
      -		if ( not ) {
      -			expr = ":not(" + expr + ")";
      -		}
      -
      -		return jQuery.find.matches(expr, elems);
      -	},
      -	
      -	dir: function( elem, dir, until ) {
      -		var matched = [], cur = elem[dir];
      -		while ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery( cur ).is( until )) ) {
      -			if ( cur.nodeType === 1 ) {
      -				matched.push( cur );
      -			}
      -			cur = cur[dir];
      -		}
      -		return matched;
      -	},
      -
      -	nth: function( cur, result, dir, elem ) {
      -		result = result || 1;
      -		var num = 0;
      -
      -		for ( ; cur; cur = cur[dir] ) {
      -			if ( cur.nodeType === 1 && ++num === result ) {
      -				break;
      -			}
      -		}
      -
      -		return cur;
      -	},
      -
      -	sibling: function( n, elem ) {
      -		var r = [];
      -
      -		for ( ; n; n = n.nextSibling ) {
      -			if ( n.nodeType === 1 && n !== elem ) {
      -				r.push( n );
      -			}
      -		}
      -
      -		return r;
      -	}
      -});
      -var rinlinejQuery = / jQuery\d+="(?:\d+|null)"/g,
      -	rleadingWhitespace = /^\s+/,
      -	rxhtmlTag = /(<([\w:]+)[^>]*?)\/>/g,
      -	rselfClosing = /^(?:area|br|col|embed|hr|img|input|link|meta|param)$/i,
      -	rtagName = /<([\w:]+)/,
      -	rtbody = /<tbody/i,
      -	rhtml = /<|&#?\w+;/,
      -	rnocache = /<script|<object|<embed|<option|<style/i,
      -	rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,  // checked="checked" or checked (html5)
      -	fcloseTag = function( all, front, tag ) {
      -		return rselfClosing.test( tag ) ?
      -			all :
      -			front + "></" + tag + ">";
      -	},
      -	wrapMap = {
      -		option: [ 1, "<select multiple='multiple'>", "</select>" ],
      -		legend: [ 1, "<fieldset>", "</fieldset>" ],
      -		thead: [ 1, "<table>", "</table>" ],
      -		tr: [ 2, "<table><tbody>", "</tbody></table>" ],
      -		td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ],
      -		col: [ 2, "<table><tbody></tbody><colgroup>", "</colgroup></table>" ],
      -		area: [ 1, "<map>", "</map>" ],
      -		_default: [ 0, "", "" ]
      -	};
      -
      -wrapMap.optgroup = wrapMap.option;
      -wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
      -wrapMap.th = wrapMap.td;
      -
      -// IE can't serialize <link> and <script> tags normally
      -if ( !jQuery.support.htmlSerialize ) {
      -	wrapMap._default = [ 1, "div<div>", "</div>" ];
      -}
      -
      -jQuery.fn.extend({
      -	text: function( text ) {
      -		if ( jQuery.isFunction(text) ) {
      -			return this.each(function(i) {
      -				var self = jQuery(this);
      -				self.text( text.call(this, i, self.text()) );
      -			});
      -		}
      -
      -		if ( typeof text !== "object" && text !== undefined ) {
      -			return this.empty().append( (this[0] && this[0].ownerDocument || document).createTextNode( text ) );
      -		}
      -
      -		return jQuery.text( this );
      -	},
      -
      -	wrapAll: function( html ) {
      -		if ( jQuery.isFunction( html ) ) {
      -			return this.each(function(i) {
      -				jQuery(this).wrapAll( html.call(this, i) );
      -			});
      -		}
      -
      -		if ( this[0] ) {
      -			// The elements to wrap the target around
      -			var wrap = jQuery( html, this[0].ownerDocument ).eq(0).clone(true);
      -
      -			if ( this[0].parentNode ) {
      -				wrap.insertBefore( this[0] );
      -			}
      -
      -			wrap.map(function() {
      -				var elem = this;
      -
      -				while ( elem.firstChild && elem.firstChild.nodeType === 1 ) {
      -					elem = elem.firstChild;
      -				}
      -
      -				return elem;
      -			}).append(this);
      -		}
      -
      -		return this;
      -	},
      -
      -	wrapInner: function( html ) {
      -		if ( jQuery.isFunction( html ) ) {
      -			return this.each(function(i) {
      -				jQuery(this).wrapInner( html.call(this, i) );
      -			});
      -		}
      -
      -		return this.each(function() {
      -			var self = jQuery( this ), contents = self.contents();
      -
      -			if ( contents.length ) {
      -				contents.wrapAll( html );
      -
      -			} else {
      -				self.append( html );
      -			}
      -		});
      -	},
      -
      -	wrap: function( html ) {
      -		return this.each(function() {
      -			jQuery( this ).wrapAll( html );
      -		});
      -	},
      -
      -	unwrap: function() {
      -		return this.parent().each(function() {
      -			if ( !jQuery.nodeName( this, "body" ) ) {
      -				jQuery( this ).replaceWith( this.childNodes );
      -			}
      -		}).end();
      -	},
      -
      -	append: function() {
      -		return this.domManip(arguments, true, function( elem ) {
      -			if ( this.nodeType === 1 ) {
      -				this.appendChild( elem );
      -			}
      -		});
      -	},
      -
      -	prepend: function() {
      -		return this.domManip(arguments, true, function( elem ) {
      -			if ( this.nodeType === 1 ) {
      -				this.insertBefore( elem, this.firstChild );
      -			}
      -		});
      -	},
      -
      -	before: function() {
      -		if ( this[0] && this[0].parentNode ) {
      -			return this.domManip(arguments, false, function( elem ) {
      -				this.parentNode.insertBefore( elem, this );
      -			});
      -		} else if ( arguments.length ) {
      -			var set = jQuery(arguments[0]);
      -			set.push.apply( set, this.toArray() );
      -			return this.pushStack( set, "before", arguments );
      -		}
      -	},
      -
      -	after: function() {
      -		if ( this[0] && this[0].parentNode ) {
      -			return this.domManip(arguments, false, function( elem ) {
      -				this.parentNode.insertBefore( elem, this.nextSibling );
      -			});
      -		} else if ( arguments.length ) {
      -			var set = this.pushStack( this, "after", arguments );
      -			set.push.apply( set, jQuery(arguments[0]).toArray() );
      -			return set;
      -		}
      -	},
      -	
      -	// keepData is for internal use only--do not document
      -	remove: function( selector, keepData ) {
      -		for ( var i = 0, elem; (elem = this[i]) != null; i++ ) {
      -			if ( !selector || jQuery.filter( selector, [ elem ] ).length ) {
      -				if ( !keepData && elem.nodeType === 1 ) {
      -					jQuery.cleanData( elem.getElementsByTagName("*") );
      -					jQuery.cleanData( [ elem ] );
      -				}
      -
      -				if ( elem.parentNode ) {
      -					 elem.parentNode.removeChild( elem );
      -				}
      -			}
      -		}
      -		
      -		return this;
      -	},
      -
      -	empty: function() {
      -		for ( var i = 0, elem; (elem = this[i]) != null; i++ ) {
      -			// Remove element nodes and prevent memory leaks
      -			if ( elem.nodeType === 1 ) {
      -				jQuery.cleanData( elem.getElementsByTagName("*") );
      -			}
      -
      -			// Remove any remaining nodes
      -			while ( elem.firstChild ) {
      -				elem.removeChild( elem.firstChild );
      -			}
      -		}
      -		
      -		return this;
      -	},
      -
      -	clone: function( events ) {
      -		// Do the clone
      -		var ret = this.map(function() {
      -			if ( !jQuery.support.noCloneEvent && !jQuery.isXMLDoc(this) ) {
      -				// IE copies events bound via attachEvent when
      -				// using cloneNode. Calling detachEvent on the
      -				// clone will also remove the events from the orignal
      -				// In order to get around this, we use innerHTML.
      -				// Unfortunately, this means some modifications to
      -				// attributes in IE that are actually only stored
      -				// as properties will not be copied (such as the
      -				// the name attribute on an input).
      -				var html = this.outerHTML, ownerDocument = this.ownerDocument;
      -				if ( !html ) {
      -					var div = ownerDocument.createElement("div");
      -					div.appendChild( this.cloneNode(true) );
      -					html = div.innerHTML;
      -				}
      -
      -				return jQuery.clean([html.replace(rinlinejQuery, "")
      -					// Handle the case in IE 8 where action=/test/> self-closes a tag
      -					.replace(/=([^="'>\s]+\/)>/g, '="$1">')
      -					.replace(rleadingWhitespace, "")], ownerDocument)[0];
      -			} else {
      -				return this.cloneNode(true);
      -			}
      -		});
      -
      -		// Copy the events from the original to the clone
      -		if ( events === true ) {
      -			cloneCopyEvent( this, ret );
      -			cloneCopyEvent( this.find("*"), ret.find("*") );
      -		}
      -
      -		// Return the cloned set
      -		return ret;
      -	},
      -
      -	html: function( value ) {
      -		if ( value === undefined ) {
      -			return this[0] && this[0].nodeType === 1 ?
      -				this[0].innerHTML.replace(rinlinejQuery, "") :
      -				null;
      -
      -		// See if we can take a shortcut and just use innerHTML
      -		} else if ( typeof value === "string" && !rnocache.test( value ) &&
      -			(jQuery.support.leadingWhitespace || !rleadingWhitespace.test( value )) &&
      -			!wrapMap[ (rtagName.exec( value ) || ["", ""])[1].toLowerCase() ] ) {
      -
      -			value = value.replace(rxhtmlTag, fcloseTag);
      -
      -			try {
      -				for ( var i = 0, l = this.length; i < l; i++ ) {
      -					// Remove element nodes and prevent memory leaks
      -					if ( this[i].nodeType === 1 ) {
      -						jQuery.cleanData( this[i].getElementsByTagName("*") );
      -						this[i].innerHTML = value;
      -					}
      -				}
      -
      -			// If using innerHTML throws an exception, use the fallback method
      -			} catch(e) {
      -				this.empty().append( value );
      -			}
      -
      -		} else if ( jQuery.isFunction( value ) ) {
      -			this.each(function(i){
      -				var self = jQuery(this), old = self.html();
      -				self.empty().append(function(){
      -					return value.call( this, i, old );
      -				});
      -			});
      -
      -		} else {
      -			this.empty().append( value );
      -		}
      -
      -		return this;
      -	},
      -
      -	replaceWith: function( value ) {
      -		if ( this[0] && this[0].parentNode ) {
      -			// Make sure that the elements are removed from the DOM before they are inserted
      -			// this can help fix replacing a parent with child elements
      -			if ( jQuery.isFunction( value ) ) {
      -				return this.each(function(i) {
      -					var self = jQuery(this), old = self.html();
      -					self.replaceWith( value.call( this, i, old ) );
      -				});
      -			}
      -
      -			if ( typeof value !== "string" ) {
      -				value = jQuery(value).detach();
      -			}
      -
      -			return this.each(function() {
      -				var next = this.nextSibling, parent = this.parentNode;
      -
      -				jQuery(this).remove();
      -
      -				if ( next ) {
      -					jQuery(next).before( value );
      -				} else {
      -					jQuery(parent).append( value );
      -				}
      -			});
      -		} else {
      -			return this.pushStack( jQuery(jQuery.isFunction(value) ? value() : value), "replaceWith", value );
      -		}
      -	},
      -
      -	detach: function( selector ) {
      -		return this.remove( selector, true );
      -	},
      -
      -	domManip: function( args, table, callback ) {
      -		var results, first, value = args[0], scripts = [], fragment, parent;
      -
      -		// We can't cloneNode fragments that contain checked, in WebKit
      -		if ( !jQuery.support.checkClone && arguments.length === 3 && typeof value === "string" && rchecked.test( value ) ) {
      -			return this.each(function() {
      -				jQuery(this).domManip( args, table, callback, true );
      -			});
      -		}
      -
      -		if ( jQuery.isFunction(value) ) {
      -			return this.each(function(i) {
      -				var self = jQuery(this);
      -				args[0] = value.call(this, i, table ? self.html() : undefined);
      -				self.domManip( args, table, callback );
      -			});
      -		}
      -
      -		if ( this[0] ) {
      -			parent = value && value.parentNode;
      -
      -			// If we're in a fragment, just use that instead of building a new one
      -			if ( jQuery.support.parentNode && parent && parent.nodeType === 11 && parent.childNodes.length === this.length ) {
      -				results = { fragment: parent };
      -
      -			} else {
      -				results = buildFragment( args, this, scripts );
      -			}
      -			
      -			fragment = results.fragment;
      -			
      -			if ( fragment.childNodes.length === 1 ) {
      -				first = fragment = fragment.firstChild;
      -			} else {
      -				first = fragment.firstChild;
      -			}
      -
      -			if ( first ) {
      -				table = table && jQuery.nodeName( first, "tr" );
      -
      -				for ( var i = 0, l = this.length; i < l; i++ ) {
      -					callback.call(
      -						table ?
      -							root(this[i], first) :
      -							this[i],
      -						i > 0 || results.cacheable || this.length > 1  ?
      -							fragment.cloneNode(true) :
      -							fragment
      -					);
      -				}
      -			}
      -
      -			if ( scripts.length ) {
      -				jQuery.each( scripts, evalScript );
      -			}
      -		}
      -
      -		return this;
      -
      -		function root( elem, cur ) {
      -			return jQuery.nodeName(elem, "table") ?
      -				(elem.getElementsByTagName("tbody")[0] ||
      -				elem.appendChild(elem.ownerDocument.createElement("tbody"))) :
      -				elem;
      -		}
      -	}
      -});
      -
      -function cloneCopyEvent(orig, ret) {
      -	var i = 0;
      -
      -	ret.each(function() {
      -		if ( this.nodeName !== (orig[i] && orig[i].nodeName) ) {
      -			return;
      -		}
      -
      -		var oldData = jQuery.data( orig[i++] ), curData = jQuery.data( this, oldData ), events = oldData && oldData.events;
      -
      -		if ( events ) {
      -			delete curData.handle;
      -			curData.events = {};
      -
      -			for ( var type in events ) {
      -				for ( var handler in events[ type ] ) {
      -					jQuery.event.add( this, type, events[ type ][ handler ], events[ type ][ handler ].data );
      -				}
      -			}
      -		}
      -	});
      -}
      -
      -function buildFragment( args, nodes, scripts ) {
      -	var fragment, cacheable, cacheresults,
      -		doc = (nodes && nodes[0] ? nodes[0].ownerDocument || nodes[0] : document);
      -
      -	// Only cache "small" (1/2 KB) strings that are associated with the main document
      -	// Cloning options loses the selected state, so don't cache them
      -	// IE 6 doesn't like it when you put <object> or <embed> elements in a fragment
      -	// Also, WebKit does not clone 'checked' attributes on cloneNode, so don't cache
      -	if ( args.length === 1 && typeof args[0] === "string" && args[0].length < 512 && doc === document &&
      -		!rnocache.test( args[0] ) && (jQuery.support.checkClone || !rchecked.test( args[0] )) ) {
      -
      -		cacheable = true;
      -		cacheresults = jQuery.fragments[ args[0] ];
      -		if ( cacheresults ) {
      -			if ( cacheresults !== 1 ) {
      -				fragment = cacheresults;
      -			}
      -		}
      -	}
      -
      -	if ( !fragment ) {
      -		fragment = doc.createDocumentFragment();
      -		jQuery.clean( args, doc, fragment, scripts );
      -	}
      -
      -	if ( cacheable ) {
      -		jQuery.fragments[ args[0] ] = cacheresults ? fragment : 1;
      -	}
      -
      -	return { fragment: fragment, cacheable: cacheable };
      -}
      -
      -jQuery.fragments = {};
      -
      -jQuery.each({
      -	appendTo: "append",
      -	prependTo: "prepend",
      -	insertBefore: "before",
      -	insertAfter: "after",
      -	replaceAll: "replaceWith"
      -}, function( name, original ) {
      -	jQuery.fn[ name ] = function( selector ) {
      -		var ret = [], insert = jQuery( selector ),
      -			parent = this.length === 1 && this[0].parentNode;
      -		
      -		if ( parent && parent.nodeType === 11 && parent.childNodes.length === 1 && insert.length === 1 ) {
      -			insert[ original ]( this[0] );
      -			return this;
      -			
      -		} else {
      -			for ( var i = 0, l = insert.length; i < l; i++ ) {
      -				var elems = (i > 0 ? this.clone(true) : this).get();
      -				jQuery.fn[ original ].apply( jQuery(insert[i]), elems );
      -				ret = ret.concat( elems );
      -			}
      -		
      -			return this.pushStack( ret, name, insert.selector );
      -		}
      -	};
      -});
      -
      -jQuery.extend({
      -	clean: function( elems, context, fragment, scripts ) {
      -		context = context || document;
      -
      -		// !context.createElement fails in IE with an error but returns typeof 'object'
      -		if ( typeof context.createElement === "undefined" ) {
      -			context = context.ownerDocument || context[0] && context[0].ownerDocument || document;
      -		}
      -
      -		var ret = [];
      -
      -		for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) {
      -			if ( typeof elem === "number" ) {
      -				elem += "";
      -			}
      -
      -			if ( !elem ) {
      -				continue;
      -			}
      -
      -			// Convert html string into DOM nodes
      -			if ( typeof elem === "string" && !rhtml.test( elem ) ) {
      -				elem = context.createTextNode( elem );
      -
      -			} else if ( typeof elem === "string" ) {
      -				// Fix "XHTML"-style tags in all browsers
      -				elem = elem.replace(rxhtmlTag, fcloseTag);
      -
      -				// Trim whitespace, otherwise indexOf won't work as expected
      -				var tag = (rtagName.exec( elem ) || ["", ""])[1].toLowerCase(),
      -					wrap = wrapMap[ tag ] || wrapMap._default,
      -					depth = wrap[0],
      -					div = context.createElement("div");
      -
      -				// Go to html and back, then peel off extra wrappers
      -				div.innerHTML = wrap[1] + elem + wrap[2];
      -
      -				// Move to the right depth
      -				while ( depth-- ) {
      -					div = div.lastChild;
      -				}
      -
      -				// Remove IE's autoinserted <tbody> from table fragments
      -				if ( !jQuery.support.tbody ) {
      -
      -					// String was a <table>, *may* have spurious <tbody>
      -					var hasBody = rtbody.test(elem),
      -						tbody = tag === "table" && !hasBody ?
      -							div.firstChild && div.firstChild.childNodes :
      -
      -							// String was a bare <thead> or <tfoot>
      -							wrap[1] === "<table>" && !hasBody ?
      -								div.childNodes :
      -								[];
      -
      -					for ( var j = tbody.length - 1; j >= 0 ; --j ) {
      -						if ( jQuery.nodeName( tbody[ j ], "tbody" ) && !tbody[ j ].childNodes.length ) {
      -							tbody[ j ].parentNode.removeChild( tbody[ j ] );
      -						}
      -					}
      -
      -				}
      -
      -				// IE completely kills leading whitespace when innerHTML is used
      -				if ( !jQuery.support.leadingWhitespace && rleadingWhitespace.test( elem ) ) {
      -					div.insertBefore( context.createTextNode( rleadingWhitespace.exec(elem)[0] ), div.firstChild );
      -				}
      -
      -				elem = div.childNodes;
      -			}
      -
      -			if ( elem.nodeType ) {
      -				ret.push( elem );
      -			} else {
      -				ret = jQuery.merge( ret, elem );
      -			}
      -		}
      -
      -		if ( fragment ) {
      -			for ( var i = 0; ret[i]; i++ ) {
      -				if ( scripts && jQuery.nodeName( ret[i], "script" ) && (!ret[i].type || ret[i].type.toLowerCase() === "text/javascript") ) {
      -					scripts.push( ret[i].parentNode ? ret[i].parentNode.removeChild( ret[i] ) : ret[i] );
      -				
      -				} else {
      -					if ( ret[i].nodeType === 1 ) {
      -						ret.splice.apply( ret, [i + 1, 0].concat(jQuery.makeArray(ret[i].getElementsByTagName("script"))) );
      -					}
      -					fragment.appendChild( ret[i] );
      -				}
      -			}
      -		}
      -
      -		return ret;
      -	},
      -	
      -	cleanData: function( elems ) {
      -		var data, id, cache = jQuery.cache,
      -			special = jQuery.event.special,
      -			deleteExpando = jQuery.support.deleteExpando;
      -		
      -		for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) {
      -			id = elem[ jQuery.expando ];
      -			
      -			if ( id ) {
      -				data = cache[ id ];
      -				
      -				if ( data.events ) {
      -					for ( var type in data.events ) {
      -						if ( special[ type ] ) {
      -							jQuery.event.remove( elem, type );
      -
      -						} else {
      -							removeEvent( elem, type, data.handle );
      -						}
      -					}
      -				}
      -				
      -				if ( deleteExpando ) {
      -					delete elem[ jQuery.expando ];
      -
      -				} else if ( elem.removeAttribute ) {
      -					elem.removeAttribute( jQuery.expando );
      -				}
      -				
      -				delete cache[ id ];
      -			}
      -		}
      -	}
      -});
      -// exclude the following css properties to add px
      -var rexclude = /z-?index|font-?weight|opacity|zoom|line-?height/i,
      -	ralpha = /alpha\([^)]*\)/,
      -	ropacity = /opacity=([^)]*)/,
      -	rfloat = /float/i,
      -	rdashAlpha = /-([a-z])/ig,
      -	rupper = /([A-Z])/g,
      -	rnumpx = /^-?\d+(?:px)?$/i,
      -	rnum = /^-?\d/,
      -
      -	cssShow = { position: "absolute", visibility: "hidden", display:"block" },
      -	cssWidth = [ "Left", "Right" ],
      -	cssHeight = [ "Top", "Bottom" ],
      -
      -	// cache check for defaultView.getComputedStyle
      -	getComputedStyle = document.defaultView && document.defaultView.getComputedStyle,
      -	// normalize float css property
      -	styleFloat = jQuery.support.cssFloat ? "cssFloat" : "styleFloat",
      -	fcamelCase = function( all, letter ) {
      -		return letter.toUpperCase();
      -	};
      -
      -jQuery.fn.css = function( name, value ) {
      -	return access( this, name, value, true, function( elem, name, value ) {
      -		if ( value === undefined ) {
      -			return jQuery.curCSS( elem, name );
      -		}
      -		
      -		if ( typeof value === "number" && !rexclude.test(name) ) {
      -			value += "px";
      -		}
      -
      -		jQuery.style( elem, name, value );
      -	});
      -};
      -
      -jQuery.extend({
      -	style: function( elem, name, value ) {
      -		// don't set styles on text and comment nodes
      -		if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 ) {
      -			return undefined;
      -		}
      -
      -		// ignore negative width and height values #1599
      -		if ( (name === "width" || name === "height") && parseFloat(value) < 0 ) {
      -			value = undefined;
      -		}
      -
      -		var style = elem.style || elem, set = value !== undefined;
      -
      -		// IE uses filters for opacity
      -		if ( !jQuery.support.opacity && name === "opacity" ) {
      -			if ( set ) {
      -				// IE has trouble with opacity if it does not have layout
      -				// Force it by setting the zoom level
      -				style.zoom = 1;
      -
      -				// Set the alpha filter to set the opacity
      -				var opacity = parseInt( value, 10 ) + "" === "NaN" ? "" : "alpha(opacity=" + value * 100 + ")";
      -				var filter = style.filter || jQuery.curCSS( elem, "filter" ) || "";
      -				style.filter = ralpha.test(filter) ? filter.replace(ralpha, opacity) : opacity;
      -			}
      -
      -			return style.filter && style.filter.indexOf("opacity=") >= 0 ?
      -				(parseFloat( ropacity.exec(style.filter)[1] ) / 100) + "":
      -				"";
      -		}
      -
      -		// Make sure we're using the right name for getting the float value
      -		if ( rfloat.test( name ) ) {
      -			name = styleFloat;
      -		}
      -
      -		name = name.replace(rdashAlpha, fcamelCase);
      -
      -		if ( set ) {
      -			style[ name ] = value;
      -		}
      -
      -		return style[ name ];
      -	},
      -
      -	css: function( elem, name, force, extra ) {
      -		if ( name === "width" || name === "height" ) {
      -			var val, props = cssShow, which = name === "width" ? cssWidth : cssHeight;
      -
      -			function getWH() {
      -				val = name === "width" ? elem.offsetWidth : elem.offsetHeight;
      -
      -				if ( extra === "border" ) {
      -					return;
      -				}
      -
      -				jQuery.each( which, function() {
      -					if ( !extra ) {
      -						val -= parseFloat(jQuery.curCSS( elem, "padding" + this, true)) || 0;
      -					}
      -
      -					if ( extra === "margin" ) {
      -						val += parseFloat(jQuery.curCSS( elem, "margin" + this, true)) || 0;
      -					} else {
      -						val -= parseFloat(jQuery.curCSS( elem, "border" + this + "Width", true)) || 0;
      -					}
      -				});
      -			}
      -
      -			if ( elem.offsetWidth !== 0 ) {
      -				getWH();
      -			} else {
      -				jQuery.swap( elem, props, getWH );
      -			}
      -
      -			return Math.max(0, Math.round(val));
      -		}
      -
      -		return jQuery.curCSS( elem, name, force );
      -	},
      -
      -	curCSS: function( elem, name, force ) {
      -		var ret, style = elem.style, filter;
      -
      -		// IE uses filters for opacity
      -		if ( !jQuery.support.opacity && name === "opacity" && elem.currentStyle ) {
      -			ret = ropacity.test(elem.currentStyle.filter || "") ?
      -				(parseFloat(RegExp.$1) / 100) + "" :
      -				"";
      -
      -			return ret === "" ?
      -				"1" :
      -				ret;
      -		}
      -
      -		// Make sure we're using the right name for getting the float value
      -		if ( rfloat.test( name ) ) {
      -			name = styleFloat;
      -		}
      -
      -		if ( !force && style && style[ name ] ) {
      -			ret = style[ name ];
      -
      -		} else if ( getComputedStyle ) {
      -
      -			// Only "float" is needed here
      -			if ( rfloat.test( name ) ) {
      -				name = "float";
      -			}
      -
      -			name = name.replace( rupper, "-$1" ).toLowerCase();
      -
      -			var defaultView = elem.ownerDocument.defaultView;
      -
      -			if ( !defaultView ) {
      -				return null;
      -			}
      -
      -			var computedStyle = defaultView.getComputedStyle( elem, null );
      -
      -			if ( computedStyle ) {
      -				ret = computedStyle.getPropertyValue( name );
      -			}
      -
      -			// We should always get a number back from opacity
      -			if ( name === "opacity" && ret === "" ) {
      -				ret = "1";
      -			}
      -
      -		} else if ( elem.currentStyle ) {
      -			var camelCase = name.replace(rdashAlpha, fcamelCase);
      -
      -			ret = elem.currentStyle[ name ] || elem.currentStyle[ camelCase ];
      -
      -			// From the awesome hack by Dean Edwards
      -			// http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291
      -
      -			// If we're not dealing with a regular pixel number
      -			// but a number that has a weird ending, we need to convert it to pixels
      -			if ( !rnumpx.test( ret ) && rnum.test( ret ) ) {
      -				// Remember the original values
      -				var left = style.left, rsLeft = elem.runtimeStyle.left;
      -
      -				// Put in the new values to get a computed value out
      -				elem.runtimeStyle.left = elem.currentStyle.left;
      -				style.left = camelCase === "fontSize" ? "1em" : (ret || 0);
      -				ret = style.pixelLeft + "px";
      -
      -				// Revert the changed values
      -				style.left = left;
      -				elem.runtimeStyle.left = rsLeft;
      -			}
      -		}
      -
      -		return ret;
      -	},
      -
      -	// A method for quickly swapping in/out CSS properties to get correct calculations
      -	swap: function( elem, options, callback ) {
      -		var old = {};
      -
      -		// Remember the old values, and insert the new ones
      -		for ( var name in options ) {
      -			old[ name ] = elem.style[ name ];
      -			elem.style[ name ] = options[ name ];
      -		}
      -
      -		callback.call( elem );
      -
      -		// Revert the old values
      -		for ( var name in options ) {
      -			elem.style[ name ] = old[ name ];
      -		}
      -	}
      -});
      -
      -if ( jQuery.expr && jQuery.expr.filters ) {
      -	jQuery.expr.filters.hidden = function( elem ) {
      -		var width = elem.offsetWidth, height = elem.offsetHeight,
      -			skip = elem.nodeName.toLowerCase() === "tr";
      -
      -		return width === 0 && height === 0 && !skip ?
      -			true :
      -			width > 0 && height > 0 && !skip ?
      -				false :
      -				jQuery.curCSS(elem, "display") === "none";
      -	};
      -
      -	jQuery.expr.filters.visible = function( elem ) {
      -		return !jQuery.expr.filters.hidden( elem );
      -	};
      -}
      -var jsc = now(),
      -	rscript = /<script(.|\s)*?\/script>/gi,
      -	rselectTextarea = /select|textarea/i,
      -	rinput = /color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week/i,
      -	jsre = /=\?(&|$)/,
      -	rquery = /\?/,
      -	rts = /(\?|&)_=.*?(&|$)/,
      -	rurl = /^(\w+:)?\/\/([^\/?#]+)/,
      -	r20 = /%20/g,
      -
      -	// Keep a copy of the old load method
      -	_load = jQuery.fn.load;
      -
      -jQuery.fn.extend({
      -	load: function( url, params, callback ) {
      -		if ( typeof url !== "string" ) {
      -			return _load.call( this, url );
      -
      -		// Don't do a request if no elements are being requested
      -		} else if ( !this.length ) {
      -			return this;
      -		}
      -
      -		var off = url.indexOf(" ");
      -		if ( off >= 0 ) {
      -			var selector = url.slice(off, url.length);
      -			url = url.slice(0, off);
      -		}
      -
      -		// Default to a GET request
      -		var type = "GET";
      -
      -		// If the second parameter was provided
      -		if ( params ) {
      -			// If it's a function
      -			if ( jQuery.isFunction( params ) ) {
      -				// We assume that it's the callback
      -				callback = params;
      -				params = null;
      -
      -			// Otherwise, build a param string
      -			} else if ( typeof params === "object" ) {
      -				params = jQuery.param( params, jQuery.ajaxSettings.traditional );
      -				type = "POST";
      -			}
      -		}
      -
      -		var self = this;
      -
      -		// Request the remote document
      -		jQuery.ajax({
      -			url: url,
      -			type: type,
      -			dataType: "html",
      -			data: params,
      -			complete: function( res, status ) {
      -				// If successful, inject the HTML into all the matched elements
      -				if ( status === "success" || status === "notmodified" ) {
      -					// See if a selector was specified
      -					self.html( selector ?
      -						// Create a dummy div to hold the results
      -						jQuery("<div />")
      -							// inject the contents of the document in, removing the scripts
      -							// to avoid any 'Permission Denied' errors in IE
      -							.append(res.responseText.replace(rscript, ""))
      -
      -							// Locate the specified elements
      -							.find(selector) :
      -
      -						// If not, just inject the full result
      -						res.responseText );
      -				}
      -
      -				if ( callback ) {
      -					self.each( callback, [res.responseText, status, res] );
      -				}
      -			}
      -		});
      -
      -		return this;
      -	},
      -
      -	serialize: function() {
      -		return jQuery.param(this.serializeArray());
      -	},
      -	serializeArray: function() {
      -		return this.map(function() {
      -			return this.elements ? jQuery.makeArray(this.elements) : this;
      -		})
      -		.filter(function() {
      -			return this.name && !this.disabled &&
      -				(this.checked || rselectTextarea.test(this.nodeName) ||
      -					rinput.test(this.type));
      -		})
      -		.map(function( i, elem ) {
      -			var val = jQuery(this).val();
      -
      -			return val == null ?
      -				null :
      -				jQuery.isArray(val) ?
      -					jQuery.map( val, function( val, i ) {
      -						return { name: elem.name, value: val };
      -					}) :
      -					{ name: elem.name, value: val };
      -		}).get();
      -	}
      -});
      -
      -// Attach a bunch of functions for handling common AJAX events
      -jQuery.each( "ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "), function( i, o ) {
      -	jQuery.fn[o] = function( f ) {
      -		return this.bind(o, f);
      -	};
      -});
      -
      -jQuery.extend({
      -
      -	get: function( url, data, callback, type ) {
      -		// shift arguments if data argument was omited
      -		if ( jQuery.isFunction( data ) ) {
      -			type = type || callback;
      -			callback = data;
      -			data = null;
      -		}
      -
      -		return jQuery.ajax({
      -			type: "GET",
      -			url: url,
      -			data: data,
      -			success: callback,
      -			dataType: type
      -		});
      -	},
      -
      -	getScript: function( url, callback ) {
      -		return jQuery.get(url, null, callback, "script");
      -	},
      -
      -	getJSON: function( url, data, callback ) {
      -		return jQuery.get(url, data, callback, "json");
      -	},
      -
      -	post: function( url, data, callback, type ) {
      -		// shift arguments if data argument was omited
      -		if ( jQuery.isFunction( data ) ) {
      -			type = type || callback;
      -			callback = data;
      -			data = {};
      -		}
      -
      -		return jQuery.ajax({
      -			type: "POST",
      -			url: url,
      -			data: data,
      -			success: callback,
      -			dataType: type
      -		});
      -	},
      -
      -	ajaxSetup: function( settings ) {
      -		jQuery.extend( jQuery.ajaxSettings, settings );
      -	},
      -
      -	ajaxSettings: {
      -		url: location.href,
      -		global: true,
      -		type: "GET",
      -		contentType: "application/x-www-form-urlencoded",
      -		processData: true,
      -		async: true,
      -		/*
      -		timeout: 0,
      -		data: null,
      -		username: null,
      -		password: null,
      -		traditional: false,
      -		*/
      -		// Create the request object; Microsoft failed to properly
      -		// implement the XMLHttpRequest in IE7 (can't request local files),
      -		// so we use the ActiveXObject when it is available
      -		// This function can be overriden by calling jQuery.ajaxSetup
      -		xhr: window.XMLHttpRequest && (window.location.protocol !== "file:" || !window.ActiveXObject) ?
      -			function() {
      -				return new window.XMLHttpRequest();
      -			} :
      -			function() {
      -				try {
      -					return new window.ActiveXObject("Microsoft.XMLHTTP");
      -				} catch(e) {}
      -			},
      -		accepts: {
      -			xml: "application/xml, text/xml",
      -			html: "text/html",
      -			script: "text/javascript, application/javascript",
      -			json: "application/json, text/javascript",
      -			text: "text/plain",
      -			_default: "*/*"
      -		}
      -	},
      -
      -	// Last-Modified header cache for next request
      -	lastModified: {},
      -	etag: {},
      -
      -	ajax: function( origSettings ) {
      -		var s = jQuery.extend(true, {}, jQuery.ajaxSettings, origSettings);
      -		
      -		var jsonp, status, data,
      -			callbackContext = origSettings && origSettings.context || s,
      -			type = s.type.toUpperCase();
      -
      -		// convert data if not already a string
      -		if ( s.data && s.processData && typeof s.data !== "string" ) {
      -			s.data = jQuery.param( s.data, s.traditional );
      -		}
      -
      -		// Handle JSONP Parameter Callbacks
      -		if ( s.dataType === "jsonp" ) {
      -			if ( type === "GET" ) {
      -				if ( !jsre.test( s.url ) ) {
      -					s.url += (rquery.test( s.url ) ? "&" : "?") + (s.jsonp || "callback") + "=?";
      -				}
      -			} else if ( !s.data || !jsre.test(s.data) ) {
      -				s.data = (s.data ? s.data + "&" : "") + (s.jsonp || "callback") + "=?";
      -			}
      -			s.dataType = "json";
      -		}
      -
      -		// Build temporary JSONP function
      -		if ( s.dataType === "json" && (s.data && jsre.test(s.data) || jsre.test(s.url)) ) {
      -			jsonp = s.jsonpCallback || ("jsonp" + jsc++);
      -
      -			// Replace the =? sequence both in the query string and the data
      -			if ( s.data ) {
      -				s.data = (s.data + "").replace(jsre, "=" + jsonp + "$1");
      -			}
      -
      -			s.url = s.url.replace(jsre, "=" + jsonp + "$1");
      -
      -			// We need to make sure
      -			// that a JSONP style response is executed properly
      -			s.dataType = "script";
      -
      -			// Handle JSONP-style loading
      -			window[ jsonp ] = window[ jsonp ] || function( tmp ) {
      -				data = tmp;
      -				success();
      -				complete();
      -				// Garbage collect
      -				window[ jsonp ] = undefined;
      -
      -				try {
      -					delete window[ jsonp ];
      -				} catch(e) {}
      -
      -				if ( head ) {
      -					head.removeChild( script );
      -				}
      -			};
      -		}
      -
      -		if ( s.dataType === "script" && s.cache === null ) {
      -			s.cache = false;
      -		}
      -
      -		if ( s.cache === false && type === "GET" ) {
      -			var ts = now();
      -
      -			// try replacing _= if it is there
      -			var ret = s.url.replace(rts, "$1_=" + ts + "$2");
      -
      -			// if nothing was replaced, add timestamp to the end
      -			s.url = ret + ((ret === s.url) ? (rquery.test(s.url) ? "&" : "?") + "_=" + ts : "");
      -		}
      -
      -		// If data is available, append data to url for get requests
      -		if ( s.data && type === "GET" ) {
      -			s.url += (rquery.test(s.url) ? "&" : "?") + s.data;
      -		}
      -
      -		// Watch for a new set of requests
      -		if ( s.global && ! jQuery.active++ ) {
      -			jQuery.event.trigger( "ajaxStart" );
      -		}
      -
      -		// Matches an absolute URL, and saves the domain
      -		var parts = rurl.exec( s.url ),
      -			remote = parts && (parts[1] && parts[1] !== location.protocol || parts[2] !== location.host);
      -
      -		// If we're requesting a remote document
      -		// and trying to load JSON or Script with a GET
      -		if ( s.dataType === "script" && type === "GET" && remote ) {
      -			var head = document.getElementsByTagName("head")[0] || document.documentElement;
      -			var script = document.createElement("script");
      -			script.src = s.url;
      -			if ( s.scriptCharset ) {
      -				script.charset = s.scriptCharset;
      -			}
      -
      -			// Handle Script loading
      -			if ( !jsonp ) {
      -				var done = false;
      -
      -				// Attach handlers for all browsers
      -				script.onload = script.onreadystatechange = function() {
      -					if ( !done && (!this.readyState ||
      -							this.readyState === "loaded" || this.readyState === "complete") ) {
      -						done = true;
      -						success();
      -						complete();
      -
      -						// Handle memory leak in IE
      -						script.onload = script.onreadystatechange = null;
      -						if ( head && script.parentNode ) {
      -							head.removeChild( script );
      -						}
      -					}
      -				};
      -			}
      -
      -			// Use insertBefore instead of appendChild  to circumvent an IE6 bug.
      -			// This arises when a base node is used (#2709 and #4378).
      -			head.insertBefore( script, head.firstChild );
      -
      -			// We handle everything using the script element injection
      -			return undefined;
      -		}
      -
      -		var requestDone = false;
      -
      -		// Create the request object
      -		var xhr = s.xhr();
      -
      -		if ( !xhr ) {
      -			return;
      -		}
      -
      -		// Open the socket
      -		// Passing null username, generates a login popup on Opera (#2865)
      -		if ( s.username ) {
      -			xhr.open(type, s.url, s.async, s.username, s.password);
      -		} else {
      -			xhr.open(type, s.url, s.async);
      -		}
      -
      -		// Need an extra try/catch for cross domain requests in Firefox 3
      -		try {
      -			// Set the correct header, if data is being sent
      -			if ( s.data || origSettings && origSettings.contentType ) {
      -				xhr.setRequestHeader("Content-Type", s.contentType);
      -			}
      -
      -			// Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
      -			if ( s.ifModified ) {
      -				if ( jQuery.lastModified[s.url] ) {
      -					xhr.setRequestHeader("If-Modified-Since", jQuery.lastModified[s.url]);
      -				}
      -
      -				if ( jQuery.etag[s.url] ) {
      -					xhr.setRequestHeader("If-None-Match", jQuery.etag[s.url]);
      -				}
      -			}
      -
      -			// Set header so the called script knows that it's an XMLHttpRequest
      -			// Only send the header if it's not a remote XHR
      -			if ( !remote ) {
      -				xhr.setRequestHeader("X-Requested-With", "XMLHttpRequest");
      -			}
      -
      -			// Set the Accepts header for the server, depending on the dataType
      -			xhr.setRequestHeader("Accept", s.dataType && s.accepts[ s.dataType ] ?
      -				s.accepts[ s.dataType ] + ", */*" :
      -				s.accepts._default );
      -		} catch(e) {}
      -
      -		// Allow custom headers/mimetypes and early abort
      -		if ( s.beforeSend && s.beforeSend.call(callbackContext, xhr, s) === false ) {
      -			// Handle the global AJAX counter
      -			if ( s.global && ! --jQuery.active ) {
      -				jQuery.event.trigger( "ajaxStop" );
      -			}
      -
      -			// close opended socket
      -			xhr.abort();
      -			return false;
      -		}
      -
      -		if ( s.global ) {
      -			trigger("ajaxSend", [xhr, s]);
      -		}
      -
      -		// Wait for a response to come back
      -		var onreadystatechange = xhr.onreadystatechange = function( isTimeout ) {
      -			// The request was aborted
      -			if ( !xhr || xhr.readyState === 0 || isTimeout === "abort" ) {
      -				// Opera doesn't call onreadystatechange before this point
      -				// so we simulate the call
      -				if ( !requestDone ) {
      -					complete();
      -				}
      -
      -				requestDone = true;
      -				if ( xhr ) {
      -					xhr.onreadystatechange = jQuery.noop;
      -				}
      -
      -			// The transfer is complete and the data is available, or the request timed out
      -			} else if ( !requestDone && xhr && (xhr.readyState === 4 || isTimeout === "timeout") ) {
      -				requestDone = true;
      -				xhr.onreadystatechange = jQuery.noop;
      -
      -				status = isTimeout === "timeout" ?
      -					"timeout" :
      -					!jQuery.httpSuccess( xhr ) ?
      -						"error" :
      -						s.ifModified && jQuery.httpNotModified( xhr, s.url ) ?
      -							"notmodified" :
      -							"success";
      -
      -				var errMsg;
      -
      -				if ( status === "success" ) {
      -					// Watch for, and catch, XML document parse errors
      -					try {
      -						// process the data (runs the xml through httpData regardless of callback)
      -						data = jQuery.httpData( xhr, s.dataType, s );
      -					} catch(err) {
      -						status = "parsererror";
      -						errMsg = err;
      -					}
      -				}
      -
      -				// Make sure that the request was successful or notmodified
      -				if ( status === "success" || status === "notmodified" ) {
      -					// JSONP handles its own success callback
      -					if ( !jsonp ) {
      -						success();
      -					}
      -				} else {
      -					jQuery.handleError(s, xhr, status, errMsg);
      -				}
      -
      -				// Fire the complete handlers
      -				complete();
      -
      -				if ( isTimeout === "timeout" ) {
      -					xhr.abort();
      -				}
      -
      -				// Stop memory leaks
      -				if ( s.async ) {
      -					xhr = null;
      -				}
      -			}
      -		};
      -
      -		// Override the abort handler, if we can (IE doesn't allow it, but that's OK)
      -		// Opera doesn't fire onreadystatechange at all on abort
      -		try {
      -			var oldAbort = xhr.abort;
      -			xhr.abort = function() {
      -				if ( xhr ) {
      -					oldAbort.call( xhr );
      -				}
      -
      -				onreadystatechange( "abort" );
      -			};
      -		} catch(e) { }
      -
      -		// Timeout checker
      -		if ( s.async && s.timeout > 0 ) {
      -			setTimeout(function() {
      -				// Check to see if the request is still happening
      -				if ( xhr && !requestDone ) {
      -					onreadystatechange( "timeout" );
      -				}
      -			}, s.timeout);
      -		}
      -
      -		// Send the data
      -		try {
      -			xhr.send( type === "POST" || type === "PUT" || type === "DELETE" ? s.data : null );
      -		} catch(e) {
      -			jQuery.handleError(s, xhr, null, e);
      -			// Fire the complete handlers
      -			complete();
      -		}
      -
      -		// firefox 1.5 doesn't fire statechange for sync requests
      -		if ( !s.async ) {
      -			onreadystatechange();
      -		}
      -
      -		function success() {
      -			// If a local callback was specified, fire it and pass it the data
      -			if ( s.success ) {
      -				s.success.call( callbackContext, data, status, xhr );
      -			}
      -
      -			// Fire the global callback
      -			if ( s.global ) {
      -				trigger( "ajaxSuccess", [xhr, s] );
      -			}
      -		}
      -
      -		function complete() {
      -			// Process result
      -			if ( s.complete ) {
      -				s.complete.call( callbackContext, xhr, status);
      -			}
      -
      -			// The request was completed
      -			if ( s.global ) {
      -				trigger( "ajaxComplete", [xhr, s] );
      -			}
      -
      -			// Handle the global AJAX counter
      -			if ( s.global && ! --jQuery.active ) {
      -				jQuery.event.trigger( "ajaxStop" );
      -			}
      -		}
      -		
      -		function trigger(type, args) {
      -			(s.context ? jQuery(s.context) : jQuery.event).trigger(type, args);
      -		}
      -
      -		// return XMLHttpRequest to allow aborting the request etc.
      -		return xhr;
      -	},
      -
      -	handleError: function( s, xhr, status, e ) {
      -		// If a local callback was specified, fire it
      -		if ( s.error ) {
      -			s.error.call( s.context || s, xhr, status, e );
      -		}
      -
      -		// Fire the global callback
      -		if ( s.global ) {
      -			(s.context ? jQuery(s.context) : jQuery.event).trigger( "ajaxError", [xhr, s, e] );
      -		}
      -	},
      -
      -	// Counter for holding the number of active queries
      -	active: 0,
      -
      -	// Determines if an XMLHttpRequest was successful or not
      -	httpSuccess: function( xhr ) {
      -		try {
      -			// IE error sometimes returns 1223 when it should be 204 so treat it as success, see #1450
      -			return !xhr.status && location.protocol === "file:" ||
      -				// Opera returns 0 when status is 304
      -				( xhr.status >= 200 && xhr.status < 300 ) ||
      -				xhr.status === 304 || xhr.status === 1223 || xhr.status === 0;
      -		} catch(e) {}
      -
      -		return false;
      -	},
      -
      -	// Determines if an XMLHttpRequest returns NotModified
      -	httpNotModified: function( xhr, url ) {
      -		var lastModified = xhr.getResponseHeader("Last-Modified"),
      -			etag = xhr.getResponseHeader("Etag");
      -
      -		if ( lastModified ) {
      -			jQuery.lastModified[url] = lastModified;
      -		}
      -
      -		if ( etag ) {
      -			jQuery.etag[url] = etag;
      -		}
      -
      -		// Opera returns 0 when status is 304
      -		return xhr.status === 304 || xhr.status === 0;
      -	},
      -
      -	httpData: function( xhr, type, s ) {
      -		var ct = xhr.getResponseHeader("content-type") || "",
      -			xml = type === "xml" || !type && ct.indexOf("xml") >= 0,
      -			data = xml ? xhr.responseXML : xhr.responseText;
      -
      -		if ( xml && data.documentElement.nodeName === "parsererror" ) {
      -			jQuery.error( "parsererror" );
      -		}
      -
      -		// Allow a pre-filtering function to sanitize the response
      -		// s is checked to keep backwards compatibility
      -		if ( s && s.dataFilter ) {
      -			data = s.dataFilter( data, type );
      -		}
      -
      -		// The filter can actually parse the response
      -		if ( typeof data === "string" ) {
      -			// Get the JavaScript object, if JSON is used.
      -			if ( type === "json" || !type && ct.indexOf("json") >= 0 ) {
      -				data = jQuery.parseJSON( data );
      -
      -			// If the type is "script", eval it in global context
      -			} else if ( type === "script" || !type && ct.indexOf("javascript") >= 0 ) {
      -				jQuery.globalEval( data );
      -			}
      -		}
      -
      -		return data;
      -	},
      -
      -	// Serialize an array of form elements or a set of
      -	// key/values into a query string
      -	param: function( a, traditional ) {
      -		var s = [];
      -		
      -		// Set traditional to true for jQuery <= 1.3.2 behavior.
      -		if ( traditional === undefined ) {
      -			traditional = jQuery.ajaxSettings.traditional;
      -		}
      -		
      -		// If an array was passed in, assume that it is an array of form elements.
      -		if ( jQuery.isArray(a) || a.jquery ) {
      -			// Serialize the form elements
      -			jQuery.each( a, function() {
      -				add( this.name, this.value );
      -			});
      -			
      -		} else {
      -			// If traditional, encode the "old" way (the way 1.3.2 or older
      -			// did it), otherwise encode params recursively.
      -			for ( var prefix in a ) {
      -				buildParams( prefix, a[prefix] );
      -			}
      -		}
      -
      -		// Return the resulting serialization
      -		return s.join("&").replace(r20, "+");
      -
      -		function buildParams( prefix, obj ) {
      -			if ( jQuery.isArray(obj) ) {
      -				// Serialize array item.
      -				jQuery.each( obj, function( i, v ) {
      -					if ( traditional || /\[\]$/.test( prefix ) ) {
      -						// Treat each array item as a scalar.
      -						add( prefix, v );
      -					} else {
      -						// If array item is non-scalar (array or object), encode its
      -						// numeric index to resolve deserialization ambiguity issues.
      -						// Note that rack (as of 1.0.0) can't currently deserialize
      -						// nested arrays properly, and attempting to do so may cause
      -						// a server error. Possible fixes are to modify rack's
      -						// deserialization algorithm or to provide an option or flag
      -						// to force array serialization to be shallow.
      -						buildParams( prefix + "[" + ( typeof v === "object" || jQuery.isArray(v) ? i : "" ) + "]", v );
      -					}
      -				});
      -					
      -			} else if ( !traditional && obj != null && typeof obj === "object" ) {
      -				// Serialize object item.
      -				jQuery.each( obj, function( k, v ) {
      -					buildParams( prefix + "[" + k + "]", v );
      -				});
      -					
      -			} else {
      -				// Serialize scalar item.
      -				add( prefix, obj );
      -			}
      -		}
      -
      -		function add( key, value ) {
      -			// If value is a function, invoke it and return its value
      -			value = jQuery.isFunction(value) ? value() : value;
      -			s[ s.length ] = encodeURIComponent(key) + "=" + encodeURIComponent(value);
      -		}
      -	}
      -});
      -var elemdisplay = {},
      -	rfxtypes = /toggle|show|hide/,
      -	rfxnum = /^([+-]=)?([\d+-.]+)(.*)$/,
      -	timerId,
      -	fxAttrs = [
      -		// height animations
      -		[ "height", "marginTop", "marginBottom", "paddingTop", "paddingBottom" ],
      -		// width animations
      -		[ "width", "marginLeft", "marginRight", "paddingLeft", "paddingRight" ],
      -		// opacity animations
      -		[ "opacity" ]
      -	];
      -
      -jQuery.fn.extend({
      -	show: function( speed, callback ) {
      -		if ( speed || speed === 0) {
      -			return this.animate( genFx("show", 3), speed, callback);
      -
      -		} else {
      -			for ( var i = 0, l = this.length; i < l; i++ ) {
      -				var old = jQuery.data(this[i], "olddisplay");
      -
      -				this[i].style.display = old || "";
      -
      -				if ( jQuery.css(this[i], "display") === "none" ) {
      -					var nodeName = this[i].nodeName, display;
      -
      -					if ( elemdisplay[ nodeName ] ) {
      -						display = elemdisplay[ nodeName ];
      -
      -					} else {
      -						var elem = jQuery("<" + nodeName + " />").appendTo("body");
      -
      -						display = elem.css("display");
      -
      -						if ( display === "none" ) {
      -							display = "block";
      -						}
      -
      -						elem.remove();
      -
      -						elemdisplay[ nodeName ] = display;
      -					}
      -
      -					jQuery.data(this[i], "olddisplay", display);
      -				}
      -			}
      -
      -			// Set the display of the elements in a second loop
      -			// to avoid the constant reflow
      -			for ( var j = 0, k = this.length; j < k; j++ ) {
      -				this[j].style.display = jQuery.data(this[j], "olddisplay") || "";
      -			}
      -
      -			return this;
      -		}
      -	},
      -
      -	hide: function( speed, callback ) {
      -		if ( speed || speed === 0 ) {
      -			return this.animate( genFx("hide", 3), speed, callback);
      -
      -		} else {
      -			for ( var i = 0, l = this.length; i < l; i++ ) {
      -				var old = jQuery.data(this[i], "olddisplay");
      -				if ( !old && old !== "none" ) {
      -					jQuery.data(this[i], "olddisplay", jQuery.css(this[i], "display"));
      -				}
      -			}
      -
      -			// Set the display of the elements in a second loop
      -			// to avoid the constant reflow
      -			for ( var j = 0, k = this.length; j < k; j++ ) {
      -				this[j].style.display = "none";
      -			}
      -
      -			return this;
      -		}
      -	},
      -
      -	// Save the old toggle function
      -	_toggle: jQuery.fn.toggle,
      -
      -	toggle: function( fn, fn2 ) {
      -		var bool = typeof fn === "boolean";
      -
      -		if ( jQuery.isFunction(fn) && jQuery.isFunction(fn2) ) {
      -			this._toggle.apply( this, arguments );
      -
      -		} else if ( fn == null || bool ) {
      -			this.each(function() {
      -				var state = bool ? fn : jQuery(this).is(":hidden");
      -				jQuery(this)[ state ? "show" : "hide" ]();
      -			});
      -
      -		} else {
      -			this.animate(genFx("toggle", 3), fn, fn2);
      -		}
      -
      -		return this;
      -	},
      -
      -	fadeTo: function( speed, to, callback ) {
      -		return this.filter(":hidden").css("opacity", 0).show().end()
      -					.animate({opacity: to}, speed, callback);
      -	},
      -
      -	animate: function( prop, speed, easing, callback ) {
      -		var optall = jQuery.speed(speed, easing, callback);
      -
      -		if ( jQuery.isEmptyObject( prop ) ) {
      -			return this.each( optall.complete );
      -		}
      -
      -		return this[ optall.queue === false ? "each" : "queue" ](function() {
      -			var opt = jQuery.extend({}, optall), p,
      -				hidden = this.nodeType === 1 && jQuery(this).is(":hidden"),
      -				self = this;
      -
      -			for ( p in prop ) {
      -				var name = p.replace(rdashAlpha, fcamelCase);
      -
      -				if ( p !== name ) {
      -					prop[ name ] = prop[ p ];
      -					delete prop[ p ];
      -					p = name;
      -				}
      -
      -				if ( prop[p] === "hide" && hidden || prop[p] === "show" && !hidden ) {
      -					return opt.complete.call(this);
      -				}
      -
      -				if ( ( p === "height" || p === "width" ) && this.style ) {
      -					// Store display property
      -					opt.display = jQuery.css(this, "display");
      -
      -					// Make sure that nothing sneaks out
      -					opt.overflow = this.style.overflow;
      -				}
      -
      -				if ( jQuery.isArray( prop[p] ) ) {
      -					// Create (if needed) and add to specialEasing
      -					(opt.specialEasing = opt.specialEasing || {})[p] = prop[p][1];
      -					prop[p] = prop[p][0];
      -				}
      -			}
      -
      -			if ( opt.overflow != null ) {
      -				this.style.overflow = "hidden";
      -			}
      -
      -			opt.curAnim = jQuery.extend({}, prop);
      -
      -			jQuery.each( prop, function( name, val ) {
      -				var e = new jQuery.fx( self, opt, name );
      -
      -				if ( rfxtypes.test(val) ) {
      -					e[ val === "toggle" ? hidden ? "show" : "hide" : val ]( prop );
      -
      -				} else {
      -					var parts = rfxnum.exec(val),
      -						start = e.cur(true) || 0;
      -
      -					if ( parts ) {
      -						var end = parseFloat( parts[2] ),
      -							unit = parts[3] || "px";
      -
      -						// We need to compute starting value
      -						if ( unit !== "px" ) {
      -							self.style[ name ] = (end || 1) + unit;
      -							start = ((end || 1) / e.cur(true)) * start;
      -							self.style[ name ] = start + unit;
      -						}
      -
      -						// If a +=/-= token was provided, we're doing a relative animation
      -						if ( parts[1] ) {
      -							end = ((parts[1] === "-=" ? -1 : 1) * end) + start;
      -						}
      -
      -						e.custom( start, end, unit );
      -
      -					} else {
      -						e.custom( start, val, "" );
      -					}
      -				}
      -			});
      -
      -			// For JS strict compliance
      -			return true;
      -		});
      -	},
      -
      -	stop: function( clearQueue, gotoEnd ) {
      -		var timers = jQuery.timers;
      -
      -		if ( clearQueue ) {
      -			this.queue([]);
      -		}
      -
      -		this.each(function() {
      -			// go in reverse order so anything added to the queue during the loop is ignored
      -			for ( var i = timers.length - 1; i >= 0; i-- ) {
      -				if ( timers[i].elem === this ) {
      -					if (gotoEnd) {
      -						// force the next step to be the last
      -						timers[i](true);
      -					}
      -
      -					timers.splice(i, 1);
      -				}
      -			}
      -		});
      -
      -		// start the next in the queue if the last step wasn't forced
      -		if ( !gotoEnd ) {
      -			this.dequeue();
      -		}
      -
      -		return this;
      -	}
      -
      -});
      -
      -// Generate shortcuts for custom animations
      -jQuery.each({
      -	slideDown: genFx("show", 1),
      -	slideUp: genFx("hide", 1),
      -	slideToggle: genFx("toggle", 1),
      -	fadeIn: { opacity: "show" },
      -	fadeOut: { opacity: "hide" }
      -}, function( name, props ) {
      -	jQuery.fn[ name ] = function( speed, callback ) {
      -		return this.animate( props, speed, callback );
      -	};
      -});
      -
      -jQuery.extend({
      -	speed: function( speed, easing, fn ) {
      -		var opt = speed && typeof speed === "object" ? speed : {
      -			complete: fn || !fn && easing ||
      -				jQuery.isFunction( speed ) && speed,
      -			duration: speed,
      -			easing: fn && easing || easing && !jQuery.isFunction(easing) && easing
      -		};
      -
      -		opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration :
      -			jQuery.fx.speeds[opt.duration] || jQuery.fx.speeds._default;
      -
      -		// Queueing
      -		opt.old = opt.complete;
      -		opt.complete = function() {
      -			if ( opt.queue !== false ) {
      -				jQuery(this).dequeue();
      -			}
      -			if ( jQuery.isFunction( opt.old ) ) {
      -				opt.old.call( this );
      -			}
      -		};
      -
      -		return opt;
      -	},
      -
      -	easing: {
      -		linear: function( p, n, firstNum, diff ) {
      -			return firstNum + diff * p;
      -		},
      -		swing: function( p, n, firstNum, diff ) {
      -			return ((-Math.cos(p*Math.PI)/2) + 0.5) * diff + firstNum;
      -		}
      -	},
      -
      -	timers: [],
      -
      -	fx: function( elem, options, prop ) {
      -		this.options = options;
      -		this.elem = elem;
      -		this.prop = prop;
      -
      -		if ( !options.orig ) {
      -			options.orig = {};
      -		}
      -	}
      -
      -});
      -
      -jQuery.fx.prototype = {
      -	// Simple function for setting a style value
      -	update: function() {
      -		if ( this.options.step ) {
      -			this.options.step.call( this.elem, this.now, this );
      -		}
      -
      -		(jQuery.fx.step[this.prop] || jQuery.fx.step._default)( this );
      -
      -		// Set display property to block for height/width animations
      -		if ( ( this.prop === "height" || this.prop === "width" ) && this.elem.style ) {
      -			this.elem.style.display = "block";
      -		}
      -	},
      -
      -	// Get the current size
      -	cur: function( force ) {
      -		if ( this.elem[this.prop] != null && (!this.elem.style || this.elem.style[this.prop] == null) ) {
      -			return this.elem[ this.prop ];
      -		}
      -
      -		var r = parseFloat(jQuery.css(this.elem, this.prop, force));
      -		return r && r > -10000 ? r : parseFloat(jQuery.curCSS(this.elem, this.prop)) || 0;
      -	},
      -
      -	// Start an animation from one number to another
      -	custom: function( from, to, unit ) {
      -		this.startTime = now();
      -		this.start = from;
      -		this.end = to;
      -		this.unit = unit || this.unit || "px";
      -		this.now = this.start;
      -		this.pos = this.state = 0;
      -
      -		var self = this;
      -		function t( gotoEnd ) {
      -			return self.step(gotoEnd);
      -		}
      -
      -		t.elem = this.elem;
      -
      -		if ( t() && jQuery.timers.push(t) && !timerId ) {
      -			timerId = setInterval(jQuery.fx.tick, 13);
      -		}
      -	},
      -
      -	// Simple 'show' function
      -	show: function() {
      -		// Remember where we started, so that we can go back to it later
      -		this.options.orig[this.prop] = jQuery.style( this.elem, this.prop );
      -		this.options.show = true;
      -
      -		// Begin the animation
      -		// Make sure that we start at a small width/height to avoid any
      -		// flash of content
      -		this.custom(this.prop === "width" || this.prop === "height" ? 1 : 0, this.cur());
      -
      -		// Start by showing the element
      -		jQuery( this.elem ).show();
      -	},
      -
      -	// Simple 'hide' function
      -	hide: function() {
      -		// Remember where we started, so that we can go back to it later
      -		this.options.orig[this.prop] = jQuery.style( this.elem, this.prop );
      -		this.options.hide = true;
      -
      -		// Begin the animation
      -		this.custom(this.cur(), 0);
      -	},
      -
      -	// Each step of an animation
      -	step: function( gotoEnd ) {
      -		var t = now(), done = true;
      -
      -		if ( gotoEnd || t >= this.options.duration + this.startTime ) {
      -			this.now = this.end;
      -			this.pos = this.state = 1;
      -			this.update();
      -
      -			this.options.curAnim[ this.prop ] = true;
      -
      -			for ( var i in this.options.curAnim ) {
      -				if ( this.options.curAnim[i] !== true ) {
      -					done = false;
      -				}
      -			}
      -
      -			if ( done ) {
      -				if ( this.options.display != null ) {
      -					// Reset the overflow
      -					this.elem.style.overflow = this.options.overflow;
      -
      -					// Reset the display
      -					var old = jQuery.data(this.elem, "olddisplay");
      -					this.elem.style.display = old ? old : this.options.display;
      -
      -					if ( jQuery.css(this.elem, "display") === "none" ) {
      -						this.elem.style.display = "block";
      -					}
      -				}
      -
      -				// Hide the element if the "hide" operation was done
      -				if ( this.options.hide ) {
      -					jQuery(this.elem).hide();
      -				}
      -
      -				// Reset the properties, if the item has been hidden or shown
      -				if ( this.options.hide || this.options.show ) {
      -					for ( var p in this.options.curAnim ) {
      -						jQuery.style(this.elem, p, this.options.orig[p]);
      -					}
      -				}
      -
      -				// Execute the complete function
      -				this.options.complete.call( this.elem );
      -			}
      -
      -			return false;
      -
      -		} else {
      -			var n = t - this.startTime;
      -			this.state = n / this.options.duration;
      -
      -			// Perform the easing function, defaults to swing
      -			var specialEasing = this.options.specialEasing && this.options.specialEasing[this.prop];
      -			var defaultEasing = this.options.easing || (jQuery.easing.swing ? "swing" : "linear");
      -			this.pos = jQuery.easing[specialEasing || defaultEasing](this.state, n, 0, 1, this.options.duration);
      -			this.now = this.start + ((this.end - this.start) * this.pos);
      -
      -			// Perform the next step of the animation
      -			this.update();
      -		}
      -
      -		return true;
      -	}
      -};
      -
      -jQuery.extend( jQuery.fx, {
      -	tick: function() {
      -		var timers = jQuery.timers;
      -
      -		for ( var i = 0; i < timers.length; i++ ) {
      -			if ( !timers[i]() ) {
      -				timers.splice(i--, 1);
      -			}
      -		}
      -
      -		if ( !timers.length ) {
      -			jQuery.fx.stop();
      -		}
      -	},
      -		
      -	stop: function() {
      -		clearInterval( timerId );
      -		timerId = null;
      -	},
      -	
      -	speeds: {
      -		slow: 600,
      - 		fast: 200,
      - 		// Default speed
      - 		_default: 400
      -	},
      -
      -	step: {
      -		opacity: function( fx ) {
      -			jQuery.style(fx.elem, "opacity", fx.now);
      -		},
      -
      -		_default: function( fx ) {
      -			if ( fx.elem.style && fx.elem.style[ fx.prop ] != null ) {
      -				fx.elem.style[ fx.prop ] = (fx.prop === "width" || fx.prop === "height" ? Math.max(0, fx.now) : fx.now) + fx.unit;
      -			} else {
      -				fx.elem[ fx.prop ] = fx.now;
      -			}
      -		}
      -	}
      -});
      -
      -if ( jQuery.expr && jQuery.expr.filters ) {
      -	jQuery.expr.filters.animated = function( elem ) {
      -		return jQuery.grep(jQuery.timers, function( fn ) {
      -			return elem === fn.elem;
      -		}).length;
      -	};
      -}
      -
      -function genFx( type, num ) {
      -	var obj = {};
      -
      -	jQuery.each( fxAttrs.concat.apply([], fxAttrs.slice(0,num)), function() {
      -		obj[ this ] = type;
      -	});
      -
      -	return obj;
      -}
      -if ( "getBoundingClientRect" in document.documentElement ) {
      -	jQuery.fn.offset = function( options ) {
      -		var elem = this[0];
      -
      -		if ( options ) { 
      -			return this.each(function( i ) {
      -				jQuery.offset.setOffset( this, options, i );
      -			});
      -		}
      -
      -		if ( !elem || !elem.ownerDocument ) {
      -			return null;
      -		}
      -
      -		if ( elem === elem.ownerDocument.body ) {
      -			return jQuery.offset.bodyOffset( elem );
      -		}
      -
      -		var box = elem.getBoundingClientRect(), doc = elem.ownerDocument, body = doc.body, docElem = doc.documentElement,
      -			clientTop = docElem.clientTop || body.clientTop || 0, clientLeft = docElem.clientLeft || body.clientLeft || 0,
      -			top  = box.top  + (self.pageYOffset || jQuery.support.boxModel && docElem.scrollTop  || body.scrollTop ) - clientTop,
      -			left = box.left + (self.pageXOffset || jQuery.support.boxModel && docElem.scrollLeft || body.scrollLeft) - clientLeft;
      -
      -		return { top: top, left: left };
      -	};
      -
      -} else {
      -	jQuery.fn.offset = function( options ) {
      -		var elem = this[0];
      -
      -		if ( options ) { 
      -			return this.each(function( i ) {
      -				jQuery.offset.setOffset( this, options, i );
      -			});
      -		}
      -
      -		if ( !elem || !elem.ownerDocument ) {
      -			return null;
      -		}
      -
      -		if ( elem === elem.ownerDocument.body ) {
      -			return jQuery.offset.bodyOffset( elem );
      -		}
      -
      -		jQuery.offset.initialize();
      -
      -		var offsetParent = elem.offsetParent, prevOffsetParent = elem,
      -			doc = elem.ownerDocument, computedStyle, docElem = doc.documentElement,
      -			body = doc.body, defaultView = doc.defaultView,
      -			prevComputedStyle = defaultView ? defaultView.getComputedStyle( elem, null ) : elem.currentStyle,
      -			top = elem.offsetTop, left = elem.offsetLeft;
      -
      -		while ( (elem = elem.parentNode) && elem !== body && elem !== docElem ) {
      -			if ( jQuery.offset.supportsFixedPosition && prevComputedStyle.position === "fixed" ) {
      -				break;
      -			}
      -
      -			computedStyle = defaultView ? defaultView.getComputedStyle(elem, null) : elem.currentStyle;
      -			top  -= elem.scrollTop;
      -			left -= elem.scrollLeft;
      -
      -			if ( elem === offsetParent ) {
      -				top  += elem.offsetTop;
      -				left += elem.offsetLeft;
      -
      -				if ( jQuery.offset.doesNotAddBorder && !(jQuery.offset.doesAddBorderForTableAndCells && /^t(able|d|h)$/i.test(elem.nodeName)) ) {
      -					top  += parseFloat( computedStyle.borderTopWidth  ) || 0;
      -					left += parseFloat( computedStyle.borderLeftWidth ) || 0;
      -				}
      -
      -				prevOffsetParent = offsetParent, offsetParent = elem.offsetParent;
      -			}
      -
      -			if ( jQuery.offset.subtractsBorderForOverflowNotVisible && computedStyle.overflow !== "visible" ) {
      -				top  += parseFloat( computedStyle.borderTopWidth  ) || 0;
      -				left += parseFloat( computedStyle.borderLeftWidth ) || 0;
      -			}
      -
      -			prevComputedStyle = computedStyle;
      -		}
      -
      -		if ( prevComputedStyle.position === "relative" || prevComputedStyle.position === "static" ) {
      -			top  += body.offsetTop;
      -			left += body.offsetLeft;
      -		}
      -
      -		if ( jQuery.offset.supportsFixedPosition && prevComputedStyle.position === "fixed" ) {
      -			top  += Math.max( docElem.scrollTop, body.scrollTop );
      -			left += Math.max( docElem.scrollLeft, body.scrollLeft );
      -		}
      -
      -		return { top: top, left: left };
      -	};
      -}
      -
      -jQuery.offset = {
      -	initialize: function() {
      -		var body = document.body, container = document.createElement("div"), innerDiv, checkDiv, table, td, bodyMarginTop = parseFloat( jQuery.curCSS(body, "marginTop", true) ) || 0,
      -			html = "<div style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;'><div></div></div><table style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;' cellpadding='0' cellspacing='0'><tr><td></td></tr></table>";
      -
      -		jQuery.extend( container.style, { position: "absolute", top: 0, left: 0, margin: 0, border: 0, width: "1px", height: "1px", visibility: "hidden" } );
      -
      -		container.innerHTML = html;
      -		body.insertBefore( container, body.firstChild );
      -		innerDiv = container.firstChild;
      -		checkDiv = innerDiv.firstChild;
      -		td = innerDiv.nextSibling.firstChild.firstChild;
      -
      -		this.doesNotAddBorder = (checkDiv.offsetTop !== 5);
      -		this.doesAddBorderForTableAndCells = (td.offsetTop === 5);
      -
      -		checkDiv.style.position = "fixed", checkDiv.style.top = "20px";
      -		// safari subtracts parent border width here which is 5px
      -		this.supportsFixedPosition = (checkDiv.offsetTop === 20 || checkDiv.offsetTop === 15);
      -		checkDiv.style.position = checkDiv.style.top = "";
      -
      -		innerDiv.style.overflow = "hidden", innerDiv.style.position = "relative";
      -		this.subtractsBorderForOverflowNotVisible = (checkDiv.offsetTop === -5);
      -
      -		this.doesNotIncludeMarginInBodyOffset = (body.offsetTop !== bodyMarginTop);
      -
      -		body.removeChild( container );
      -		body = container = innerDiv = checkDiv = table = td = null;
      -		jQuery.offset.initialize = jQuery.noop;
      -	},
      -
      -	bodyOffset: function( body ) {
      -		var top = body.offsetTop, left = body.offsetLeft;
      -
      -		jQuery.offset.initialize();
      -
      -		if ( jQuery.offset.doesNotIncludeMarginInBodyOffset ) {
      -			top  += parseFloat( jQuery.curCSS(body, "marginTop",  true) ) || 0;
      -			left += parseFloat( jQuery.curCSS(body, "marginLeft", true) ) || 0;
      -		}
      -
      -		return { top: top, left: left };
      -	},
      -	
      -	setOffset: function( elem, options, i ) {
      -		// set position first, in-case top/left are set even on static elem
      -		if ( /static/.test( jQuery.curCSS( elem, "position" ) ) ) {
      -			elem.style.position = "relative";
      -		}
      -		var curElem   = jQuery( elem ),
      -			curOffset = curElem.offset(),
      -			curTop    = parseInt( jQuery.curCSS( elem, "top",  true ), 10 ) || 0,
      -			curLeft   = parseInt( jQuery.curCSS( elem, "left", true ), 10 ) || 0;
      -
      -		if ( jQuery.isFunction( options ) ) {
      -			options = options.call( elem, i, curOffset );
      -		}
      -
      -		var props = {
      -			top:  (options.top  - curOffset.top)  + curTop,
      -			left: (options.left - curOffset.left) + curLeft
      -		};
      -		
      -		if ( "using" in options ) {
      -			options.using.call( elem, props );
      -		} else {
      -			curElem.css( props );
      -		}
      -	}
      -};
      -
      -
      -jQuery.fn.extend({
      -	position: function() {
      -		if ( !this[0] ) {
      -			return null;
      -		}
      -
      -		var elem = this[0],
      -
      -		// Get *real* offsetParent
      -		offsetParent = this.offsetParent(),
      -
      -		// Get correct offsets
      -		offset       = this.offset(),
      -		parentOffset = /^body|html$/i.test(offsetParent[0].nodeName) ? { top: 0, left: 0 } : offsetParent.offset();
      -
      -		// Subtract element margins
      -		// note: when an element has margin: auto the offsetLeft and marginLeft
      -		// are the same in Safari causing offset.left to incorrectly be 0
      -		offset.top  -= parseFloat( jQuery.curCSS(elem, "marginTop",  true) ) || 0;
      -		offset.left -= parseFloat( jQuery.curCSS(elem, "marginLeft", true) ) || 0;
      -
      -		// Add offsetParent borders
      -		parentOffset.top  += parseFloat( jQuery.curCSS(offsetParent[0], "borderTopWidth",  true) ) || 0;
      -		parentOffset.left += parseFloat( jQuery.curCSS(offsetParent[0], "borderLeftWidth", true) ) || 0;
      -
      -		// Subtract the two offsets
      -		return {
      -			top:  offset.top  - parentOffset.top,
      -			left: offset.left - parentOffset.left
      -		};
      -	},
      -
      -	offsetParent: function() {
      -		return this.map(function() {
      -			var offsetParent = this.offsetParent || document.body;
      -			while ( offsetParent && (!/^body|html$/i.test(offsetParent.nodeName) && jQuery.css(offsetParent, "position") === "static") ) {
      -				offsetParent = offsetParent.offsetParent;
      -			}
      -			return offsetParent;
      -		});
      -	}
      -});
      -
      -
      -// Create scrollLeft and scrollTop methods
      -jQuery.each( ["Left", "Top"], function( i, name ) {
      -	var method = "scroll" + name;
      -
      -	jQuery.fn[ method ] = function(val) {
      -		var elem = this[0], win;
      -		
      -		if ( !elem ) {
      -			return null;
      -		}
      -
      -		if ( val !== undefined ) {
      -			// Set the scroll offset
      -			return this.each(function() {
      -				win = getWindow( this );
      -
      -				if ( win ) {
      -					win.scrollTo(
      -						!i ? val : jQuery(win).scrollLeft(),
      -						 i ? val : jQuery(win).scrollTop()
      -					);
      -
      -				} else {
      -					this[ method ] = val;
      -				}
      -			});
      -		} else {
      -			win = getWindow( elem );
      -
      -			// Return the scroll offset
      -			return win ? ("pageXOffset" in win) ? win[ i ? "pageYOffset" : "pageXOffset" ] :
      -				jQuery.support.boxModel && win.document.documentElement[ method ] ||
      -					win.document.body[ method ] :
      -				elem[ method ];
      -		}
      -	};
      -});
      -
      -function getWindow( elem ) {
      -	return ("scrollTo" in elem && elem.document) ?
      -		elem :
      -		elem.nodeType === 9 ?
      -			elem.defaultView || elem.parentWindow :
      -			false;
      -}
      -// Create innerHeight, innerWidth, outerHeight and outerWidth methods
      -jQuery.each([ "Height", "Width" ], function( i, name ) {
      -
      -	var type = name.toLowerCase();
      -
      -	// innerHeight and innerWidth
      -	jQuery.fn["inner" + name] = function() {
      -		return this[0] ?
      -			jQuery.css( this[0], type, false, "padding" ) :
      -			null;
      -	};
      -
      -	// outerHeight and outerWidth
      -	jQuery.fn["outer" + name] = function( margin ) {
      -		return this[0] ?
      -			jQuery.css( this[0], type, false, margin ? "margin" : "border" ) :
      -			null;
      -	};
      -
      -	jQuery.fn[ type ] = function( size ) {
      -		// Get window width or height
      -		var elem = this[0];
      -		if ( !elem ) {
      -			return size == null ? null : this;
      -		}
      -		
      -		if ( jQuery.isFunction( size ) ) {
      -			return this.each(function( i ) {
      -				var self = jQuery( this );
      -				self[ type ]( size.call( this, i, self[ type ]() ) );
      -			});
      -		}
      -
      -		return ("scrollTo" in elem && elem.document) ? // does it walk and quack like a window?
      -			// Everyone else use document.documentElement or document.body depending on Quirks vs Standards mode
      -			elem.document.compatMode === "CSS1Compat" && elem.document.documentElement[ "client" + name ] ||
      -			elem.document.body[ "client" + name ] :
      -
      -			// Get document width or height
      -			(elem.nodeType === 9) ? // is it a document
      -				// Either scroll[Width/Height] or offset[Width/Height], whichever is greater
      -				Math.max(
      -					elem.documentElement["client" + name],
      -					elem.body["scroll" + name], elem.documentElement["scroll" + name],
      -					elem.body["offset" + name], elem.documentElement["offset" + name]
      -				) :
      -
      -				// Get or set width or height on the element
      -				size === undefined ?
      -					// Get width or height on the element
      -					jQuery.css( elem, type ) :
      -
      -					// Set the width or height on the element (default to pixels if value is unitless)
      -					this.css( type, typeof size === "string" ? size : size + "px" );
      -	};
      -
      -});
      -// Expose jQuery to the global object
      -window.jQuery = window.$ = jQuery;
      -
      -})(window);
      Index: src/main/resources/META-INF/static/scripts/tinybox.js
      ===================================================================
      --- src/main/resources/META-INF/static/scripts/tinybox.js	(revision 1148250)
      +++ src/main/resources/META-INF/static/scripts/tinybox.js	(working copy)
      @@ -1,342 +0,0 @@
      -var TINY={};
      -
      -function T$(i){return document.getElementById(i)}
      -
      -TINY.box=function(){
      -	var p,m,b,fn,ic,iu,iw,ih,ia,f=0;
      -	return{
      -		show:function(c,u,w,h,a,t){
      -			if(!f){
      -				p=document.createElement('div'); p.id='tinybox';
      -				m=document.createElement('div'); m.id='tinymask';
      -				b=document.createElement('div'); b.id='tinycontent';
      -				document.body.appendChild(m); document.body.appendChild(p); p.appendChild(b);
      -				m.onclick=TINY.box.hide; window.onresize=TINY.box.resize; f=1
      -				var useragent = navigator.userAgent;
      -				
      -				if(useragent.indexOf('MSIE')> -1){
      -					p.style.marginLeft = "50%";
      -					p.style.marginTop = "15%";
      -					p.style.position = "absolute";
      -				}
      -				else{
      -					p.style.position = "absolute";
      -				}
      -			}
      -			if(!a&&!u){
      -				p.style.width=w?w+'px':'auto'; p.style.height=h?h+'px':'auto';
      -				p.style.backgroundImage='none'; b.innerHTML=c
      -			}else{
      -				b.style.display='none'; p.style.width=p.style.height='100px'
      -			}
      -			this.mask();
      -			ic=c; iu=u; iw=w; ih=h; ia=a; this.alpha(m,1,80,3);
      -			if(t){setTimeout(function(){TINY.box.hide()},1000*t)}
      -		},
      -		showS:function(c,u,w,h,a,t){
      -			if(!f){
      -				p=document.createElement('div'); p.id='tinybox';
      -				m=document.createElement('div'); m.id='tinymask';
      -				document.body.appendChild(m); document.body.appendChild(p);
      -				m.onclick=TINY.box.hide; window.onresize=TINY.box.resize; f=1
      -				var useragent = navigator.userAgent;
      -				
      -				if(useragent.indexOf('MSIE')> -1){
      -					p.style.marginLeft = "50%";
      -					p.style.marginTop = "15%";
      -					p.style.position = "absolute";
      -				}
      -				else{
      -					p.style.position = "absolute";
      -				}
      -			}
      -			p.style.width=p.style.height='100px';
      -			this.mask();
      -			ic=c; iu=u; iw=w; ih=h; ia=a; this.alpha(m,1,80,3);
      -			if(t){setTimeout(function(){TINY.box.hide()},1000*t)}
      -		},
      -		showL:function(c,u,w,h,a,t){
      -			
      -			b=document.createElement('div'); b.id='tinycontent';
      -			p.appendChild(b);
      -			
      -			p.style.width=w?w+'px':'auto'; p.style.height=h?h+'px':'auto';
      -			p.style.backgroundImage='none'; b.innerHTML=c
      -			
      -		},
      -		fill:function(c,u,w,h,a){
      -			if(u){
      -				p.style.backgroundImage='';
      -				var x=window.XMLHttpRequest?new XMLHttpRequest():new ActiveXObject('Microsoft.XMLHTTP');
      -				x.onreadystatechange=function(){
      -					if(x.readyState==4&&x.status==200){TINY.box.psh(x.responseText,w,h,a)}
      -				};
      -				x.open('GET',c,1); x.send(null)
      -			}else{
      -				this.psh(c,w,h,a)
      -			}
      -		},
      -		psh:function(c,w,h,a){
      -			if(a){
      -				if(!w||!h){
      -					var x=p.style.width, y=p.style.height; b.innerHTML=c;
      -					p.style.width=w?w+'px':''; p.style.height=h?h+'px':'';
      -					b.style.display='';
      -					w=parseInt(b.offsetWidth); h=parseInt(b.offsetHeight);
      -					b.style.display='none'; p.style.width=x; p.style.height=y;
      -				}else{
      -					b.innerHTML=c
      -				}
      -				this.size(p,w,h,4)
      -			}else{
      -				p.style.backgroundImage='none'
      -			}
      -		},
      -		hide:function(){
      -			TINY.box.alpha(p,-1,0,3)
      -		},
      -		resize:function(){
      -			TINY.box.pos(); TINY.box.mask()
      -		},
      -		mask:function(){
      -			m.style.height=TINY.page.theight()+'px';
      -			m.style.width=''; m.style.width=TINY.page.twidth()+'px'
      -		},
      -		pos:function(){
      -			var t=(TINY.page.height()/2)-(p.offsetHeight/2); t=t<10?10:t;
      -			p.style.top=(t+TINY.page.top())+'px';
      -			p.style.left=(TINY.page.width()/2)-(p.offsetWidth/2)+'px'
      -		},
      -		alpha:function(e,d,a,s){
      -			clearInterval(e.ai);
      -			if(d==1){
      -				e.style.opacity=0; e.style.filter='alpha(opacity=0)';
      -				e.style.display='block'; this.pos()
      -			}
      -			e.ai=setInterval(function(){TINY.box.twalpha(e,a,d,s)},20)
      -		},
      -		twalpha:function(e,a,d,s){
      -			var o=Math.round(e.style.opacity*100);
      -			if(o==a){
      -				clearInterval(e.ai);
      -				if(d==-1){
      -					e.style.display='none';
      -					e==p?TINY.box.alpha(m,-1,0,2):b.innerHTML=p.style.backgroundImage=''
      -				}else{
      -					e==m?this.alpha(p,1,100,5):TINY.box.fill(ic,iu,iw,ih,ia)
      -				}
      -			}else{
      -				var n=o+Math.ceil(Math.abs(a-o)/s)*d;
      -				e.style.opacity=n/100; e.style.filter='alpha(opacity='+n+')'
      -			}
      -		},
      -		size:function(e,w,h,s){
      -			e=typeof e=='object'?e:T$(e); clearInterval(e.si);
      -			var ow=e.offsetWidth, oh=e.offsetHeight,
      -			wo=ow-parseInt(e.style.width), ho=oh-parseInt(e.style.height);
      -			var wd=ow-wo>w?-1:1, hd=(oh-ho>h)?-1:1;
      -			e.si=setInterval(function(){TINY.box.twsize(e,w,wo,wd,h,ho,hd,s)},20)
      -		},
      -		twsize:function(e,w,wo,wd,h,ho,hd,s){
      -			var ow=e.offsetWidth-wo, oh=e.offsetHeight-ho;
      -			if(ow==w&&oh==h){
      -				clearInterval(e.si); p.style.backgroundImage='none'; b.style.display='block'
      -			}else{
      -				if(ow!=w){e.style.width=ow+(Math.ceil(Math.abs(w-ow)/s)*wd)+'px'}
      -				if(oh!=h){e.style.height=oh+(Math.ceil(Math.abs(h-oh)/s)*hd)+'px'}
      -				this.pos()
      -			}
      -		},
      -		work:function(){
      -			var tinybox = document.getElementById("tinybox");
      -			if(tinybox != null){
      -				tinybox.style.background = "#fff url(img/loading.gif) no-repeat 50% 50%";
      -				tinybox.style.display = "block";
      -				var tinycontent = document.getElementById("tinycontent");
      -				if(tinycontent != null){
      -					tinycontent.innerHTML = "<br>";
      -					//tinycontent.style.background = "#fff url(img/loading.gif) no-repeat 40% 40%";
      -					//tinycontent.style.display = 'none';
      -				}
      -				
      -			}
      -		},
      -		searchShow:function(c,u,w,h,a,t){
      -			if(!f){
      -				p=document.createElement('div'); p.id='tinybox';
      -				m=document.createElement('div'); m.id='tinymask';
      -				document.body.appendChild(m); document.body.appendChild(p);
      -				m.onclick=TINY.box.hide; window.onresize=TINY.box.resize; f=1
      -				var useragent = navigator.userAgent;
      -				
      -				if(useragent.indexOf('MSIE')> -1){
      -					p.style.marginLeft = "50%";
      -					p.style.marginTop = "15%";
      -					p.style.position = "absolute";
      -				}
      -				else{
      -					p.style.position = "absolute";
      -				}
      -			}
      -			
      -			this.mask();
      -			ic=c; iu=u; iw=w; ih=h; ia=a; this.alpha(m,1,80,3);
      -			if(t){setTimeout(function(){TINY.box.hide()},1000*t)}
      -		}
      -	}
      -}();
      -
      -TINY.page=function(){
      -	return{
      -		top:function(){return document.body.scrollTop||document.documentElement.scrollTop},
      -		width:function(){return self.innerWidth||document.documentElement.clientWidth},
      -		height:function(){return self.innerHeight||document.documentElement.clientHeight},
      -		theight:function(){
      -			var d=document, b=d.body, e=d.documentElement;
      -			return Math.max(Math.max(b.scrollHeight,e.scrollHeight),Math.max(b.clientHeight,e.clientHeight))
      -		},
      -		twidth:function(){
      -			var d=document, b=d.body, e=d.documentElement;
      -			return Math.max(Math.max(b.scrollWidth,e.scrollWidth),Math.max(b.clientWidth,e.clientWidth))
      -		}
      -	}
      -}();
      -
      -
      -function popupCentrata(req, parameter) {
      -	
      -	var ebhclibrary = readCookie("ebhclibrary");
      -	var auth;
      -	var remember = false;
      -	if(ebhclibrary != null){
      -		auth = ebhclibrary.split(";");
      -		auth = auth[0].split(" ");
      -		remember = true;
      -	}
      -	
      -	var content2;
      -	
      -	if(remember){
      -		content2 = "<div id=\"popupbox\">" +
      -					"<form name=\"login\" action=\"\" method=\"post\">" +
      -					"<center>Username:</center>" +
      -					"<center><input id=\"username\" name=\"username\" value=\""+auth[0]+"\" size=\"14\" /></center>" +
      -					"<center>Password:</center>" +
      -					"<center><input id=\"password\" name=\"password\" type=\"password\" value=\""+auth[1]+"\" size=\"14\" /></center>";
      -	}
      -	else{
      -		content2 = "<div id=\"popupbox\">" +
      -					"<form name=\"login\" action=\"\" method=\"post\">" +
      -					"<center>Username:</center>" +
      -					"<center><input id=\"username\" name=\"username\" size=\"14\" /></center>" +
      -					"<center>Password:</center>" +
      -					"<center><input id=\"password\" name=\"password\" type=\"password\" size=\"14\" /></center>";
      -	}
      -					
      -	
      -	if(req != null){
      -		req = "'"+req+"'";
      -	}
      -	if(parameter != null){
      -		parameter = "'"+parameter+"'";
      -	}
      -	
      -	if(remember){
      -		content2 += "<center><input id=\"rememberme\" type=\"checkbox\" name=\"rememberme\" value=\"rememberme\" checked/>Remember me</center></form>";
      -	}
      -	else{
      -		content2 += "<center><input id=\"rememberme\" type=\"checkbox\" name=\"rememberme\" value=\"rememberme\"/>Remember me</center></form>";
      -	}
      -	
      -	content2 += "<center><input type=\"button\" name=\"submit\" value=\"login\" onclick=\"javascript:loggin("+req+", "+parameter+")\"/></center></form>" +
      -				"<center><span id=\"loginincorrect\" style=\"color:red\"></span></center>";
      -	
      -	//var content2 = "<img src='img/full-text.gif' width='298' height='373' alt='' />";
      -	
      -	//TINY.box.show(content2,0,0,0,1);
      -	TINY.box.showL(content2,0,0,0,1);
      -
      - }
      -
      -function poplog(req, parameter) {
      -	
      -	var ebhclibrary = readCookie("ebhclibrary");
      -	var auth;
      -	var remember = false;
      -	if(ebhclibrary != null){
      -		auth = ebhclibrary.split(";");
      -		auth = auth[0].split(" ");
      -		remember = true;
      -	}
      -	
      -	var content2;
      -	
      -	if(remember){
      -		content2 = "<div id=\"popupbox\">" +
      -					"<form name=\"login\" action=\"\" method=\"post\">" +
      -					"<center>Username:</center>" +
      -					"<center><input id=\"username\" name=\"username\" value=\""+auth[0]+"\" size=\"14\" /></center>" +
      -					"<center>Password:</center>" +
      -					"<center><input id=\"password\" name=\"password\" type=\"password\" value=\""+auth[1]+"\" size=\"14\" /></center>";
      -	}
      -	else{
      -		content2 = "<div id=\"popupbox\">" +
      -					"<form name=\"login\" action=\"\" method=\"post\">" +
      -					"<center>Username:</center>" +
      -					"<center><input id=\"username\" name=\"username\" size=\"14\" /></center>" +
      -					"<center>Password:</center>" +
      -					"<center><input id=\"password\" name=\"password\" type=\"password\" size=\"14\" /></center>";
      -	}
      -					
      -	
      -	if(req != null){
      -		req = "'"+req+"'";
      -	}
      -	if(parameter != null){
      -		parameter = "'"+parameter+"'";
      -	}
      -	
      -	if(remember){
      -		content2 += "<center><input id=\"rememberme\" type=\"checkbox\" name=\"rememberme\" value=\"rememberme\" checked/>Remember me</center></form>";
      -	}
      -	else{
      -		content2 += "<center><input id=\"rememberme\" type=\"checkbox\" name=\"rememberme\" value=\"rememberme\"/>Remember me</center></form>";
      -	}
      -	
      -	content2 += "<center><input type=\"button\" name=\"submit\" value=\"login\" onclick=\"javascript:loggin("+req+", "+parameter+")\"/></center></form>" +
      -				"<center><span id=\"loginincorrect\" style=\"color:red\"></span></center>";
      -	
      -	//var content2 = "<img src='img/full-text.gif' width='298' height='373' alt='' />";
      -	
      -	TINY.box.show(content2,0,0,0,1);
      -
      - }
      -
      -
      -function readCookie(name) {
      -	var nameEQ = name + "=";
      -	var ca = document.cookie.split(';');
      -	for(var i=0;i < ca.length;i++) {
      -		var c = ca[i];
      -		while (c.charAt(0)==' ') c = c.substring(1,c.length);
      -		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
      -	}
      -	return null;
      -}
      -
      -function createCookie(name,value,days) {
      -	if (days) {
      -		var date = new Date();
      -		date.setTime(date.getTime()+(days*24*60*60*1000));
      -		var expires = "; expires="+date.toGMTString();
      -	}
      -	else var expires = "";
      -	
      -	document.cookie = name+"="+value+expires+"; path=/";
      -}
      -
      -function eraseCookie(name) {
      -	createCookie(name,"",-1);
      -}
      -
      -
      Index: src/main/resources/META-INF/static/scripts/jit.js
      ===================================================================
      --- src/main/resources/META-INF/static/scripts/jit.js	(revision 1148250)
      +++ src/main/resources/META-INF/static/scripts/jit.js	(working copy)
      @@ -1,9046 +0,0 @@
      -(function () { 
      -
      -/*
      -  File: Core.js
      -  
      -  Description:
      -  
      -  Provides common utility functions and the Class object used internally by the library.
      -  
      -  Also provides the <TreeUtil> object for manipulating JSON tree structures
      -  
      -  Some of the Basic utility functions and the Class system are based in the MooTools Framework <http://mootools.net>. Copyright (c) 2006-2009 Valerio Proietti, <http://mad4milk.net/>. MIT license <http://mootools.net/license.txt>.
      -  
      -  Author: 
      -  
      -  Nicolas Garcia Belmonte
      -  
      -  Copyright: 
      -  
      -  Copyright 2008-2009 by Nicolas Garcia Belmonte.
      -  
      -  Homepage: 
      -  
      -  <http://thejit.org>
      -  
      -  Version: 
      -  
      -  1.1.3
      -
      -  License: 
      -  
      -  BSD License
      - 
      -> Redistribution and use in source and binary forms, with or without
      -> modification, are permitted provided that the following conditions are met:
      ->      * Redistributions of source code must retain the above copyright
      ->        notice, this list of conditions and the following disclaimer.
      ->      * Redistributions in binary form must reproduce the above copyright
      ->        notice, this list of conditions and the following disclaimer in the
      ->        documentation and/or other materials provided with the distribution.
      ->      * Neither the name of the organization nor the
      ->        names of its contributors may be used to endorse or promote products
      ->        derived from this software without specific prior written permission.
      ->
      ->  THIS SOFTWARE IS PROVIDED BY Nicolas Garcia Belmonte ``AS IS'' AND ANY
      ->  EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
      ->  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
      ->  DISCLAIMED. IN NO EVENT SHALL Nicolas Garcia Belmonte BE LIABLE FOR ANY
      ->  DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
      ->  (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
      ->  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
      ->  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
      ->  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
      ->  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
      - */
      -
      -
      -function $empty() {};
      -
      -function $extend(original, extended){
      -    for (var key in (extended || {})) original[key] = extended[key];
      -    return original;
      -};
      -
      -function $lambda(value){
      -    return (typeof value == 'function') ? value : function(){
      -        return value;
      -    };
      -};
      -
      -var $time = Date.now || function(){
      -    return +new Date;
      -};
      -
      -function $splat(obj){
      -    var type = $type(obj);
      -    return (type) ? ((type != 'array') ? [obj] : obj) : [];
      -};
      -
      -var $type = function(elem) {
      -  return $type.s.call(elem).match(/^\[object\s(.*)\]$/)[1].toLowerCase();
      -};
      -$type.s = Object.prototype.toString;
      -
      -function $each(iterable, fn){
      -    var type = $type(iterable);
      -  if(type == 'object') {
      -    for (var key in iterable) fn(iterable[key], key);
      -  } else {
      -    for(var i=0; i < iterable.length; i++) fn(iterable[i], i);
      -  }
      -};
      -
      -function $merge(){
      -    var mix = {};
      -    for (var i = 0, l = arguments.length; i < l; i++){
      -        var object = arguments[i];
      -        if ($type(object) != 'object') continue;
      -        for (var key in object){
      -            var op = object[key], mp = mix[key];
      -            mix[key] = (mp && $type(op) == 'object' && $type(mp) == 'object') ? $merge(mp, op) : $unlink(op);
      -        }
      -    }
      -    return mix;
      -};
      -
      -function $unlink(object){
      -    var unlinked;
      -    switch ($type(object)){
      -        case 'object':
      -            unlinked = {};
      -            for (var p in object) unlinked[p] = $unlink(object[p]);
      -        break;
      -        case 'array':
      -            unlinked = [];
      -            for (var i = 0, l = object.length; i < l; i++) unlinked[i] = $unlink(object[i]);
      -        break;
      -        default: return object;
      -    }
      -    return unlinked;
      -};
      -
      -function $rgbToHex(srcArray, array){
      -    if (srcArray.length < 3) return null;
      -    if (srcArray.length == 4 && srcArray[3] == 0 && !array) return 'transparent';
      -    var hex = [];
      -    for (var i = 0; i < 3; i++){
      -        var bit = (srcArray[i] - 0).toString(16);
      -        hex.push((bit.length == 1) ? '0' + bit : bit);
      -    }
      -    return (array) ? hex : '#' + hex.join('');
      -};
      -
      -function $destroy(elem) {
      -   $clean(elem);
      -   if(elem.parentNode) elem.parentNode.removeChild(elem);
      -   if(elem.clearAttributes) elem.clearAttributes(); 
      -};
      -
      -function $clean(elem) {
      -  for(var ch = elem.childNodes, i=0; i < ch.length; i++) {
      -      $destroy(ch[i]);
      -  }  
      -};
      -
      -function $addEvent(obj, type, fn) {
      -    if (obj.addEventListener) 
      -        obj.addEventListener(type, fn, false);
      -    else 
      -        obj.attachEvent('on' + type, fn);
      -};
      -
      -function $hasClass(obj, klass) {
      -    return (' ' + obj.className + ' ').indexOf(' ' + klass + ' ') > -1;
      -};
      -
      -function $addClass(obj, klass) {
      -    if(!$hasClass(obj, klass)) obj.className = (obj.className + " " + klass);
      -};
      -
      -function $removeClass(obj, klass) {
      -    obj.className = obj.className.replace(new RegExp('(^|\\s)' + klass + '(?:\\s|$)'), '$1');
      -};
      -
      -function $get(id) {
      -  return document.getElementById(id);  
      -};
      -
      -var Class = function(properties){
      -  properties = properties || {};
      -  var klass = function(){
      -//      not defining any attributes in Class properties.
      -//    for (var key in this){
      -//          if (typeof this[key] != 'function') this[key] = $unlink(this[key]);
      -//      }
      -      this.constructor = klass;
      -      if (Class.prototyping) return this;
      -      var instance = (this.initialize) ? this.initialize.apply(this, arguments) : this;
      -      return instance;
      -  };
      -  
      -  for (var mutator in Class.Mutators){
      -      if (!properties[mutator]) continue;
      -      properties = Class.Mutators[mutator](properties, properties[mutator]);
      -      delete properties[mutator];
      -  }
      -  
      -  $extend(klass, this);
      -  klass.constructor = Class;
      -  klass.prototype = properties;
      -  return klass;
      -};
      -
      -Class.Mutators = {
      -
      -    Extends: function(self, klass){
      -        Class.prototyping = klass.prototype;
      -        var subclass = new klass;
      -        delete subclass.parent;
      -        subclass = Class.inherit(subclass, self);
      -        delete Class.prototyping;
      -        return subclass;
      -    },
      -
      -    Implements: function(self, klasses){
      -        $each($splat(klasses), function(klass){
      -            Class.prototying = klass;
      -            $extend(self, ($type(klass) == 'function') ? new klass : klass);
      -            delete Class.prototyping;
      -        });
      -        return self;
      -    }
      -
      -};
      -
      -$extend(Class, {
      -
      -    inherit: function(object, properties){
      -        var caller = arguments.callee.caller;
      -        for (var key in properties){
      -            var override = properties[key];
      -            var previous = object[key];
      -            var type = $type(override);
      -            if (previous && type == 'function'){
      -                if (override != previous){
      -                    if (caller){
      -                        override.__parent = previous;
      -                        object[key] = override;
      -                    } else {
      -                        Class.override(object, key, override);
      -                    }
      -                }
      -            } else if(type == 'object'){
      -                object[key] = $merge(previous, override);
      -            } else {
      -                object[key] = override;
      -            }
      -        }
      -
      -        if (caller) object.parent = function(){
      -            return arguments.callee.caller.__parent.apply(this, arguments);
      -        };
      -
      -        return object;
      -    },
      -
      -    override: function(object, name, method){
      -        var parent = Class.prototyping;
      -        if (parent && object[name] != parent[name]) parent = null;
      -        var override = function(){
      -            var previous = this.parent;
      -            this.parent = parent ? parent[name] : object[name];
      -            var value = method.apply(this, arguments);
      -            this.parent = previous;
      -            return value;
      -        };
      -        object[name] = override;
      -    }
      -
      -});
      -
      -
      -Class.prototype.implement = function(){
      -    var proto = this.prototype;
      -    $each(Array.prototype.slice.call(arguments || []), function(properties){
      -        Class.inherit(proto, properties);
      -    });
      -    return this;
      -};
      -
      -/*
      -   Object: TreeUtil
      -
      -   Some common JSON tree manipulation methods.
      -*/
      -this.TreeUtil = {
      -
      -    /*
      -       Method: prune
      -    
      -       Clears all tree nodes having depth greater than maxLevel.
      -    
      -       Parameters:
      -    
      -          tree - A JSON tree object. For more information please see <Loader.loadJSON>.
      -          maxLevel - An integer specifying the maximum level allowed for this tree. All nodes having depth greater than max level will be deleted.
      -
      -    */
      -    prune: function(tree, maxLevel) {
      -        this.each(tree, function(elem, i) {
      -            if(i == maxLevel && elem.children) {
      -                delete elem.children;
      -                elem.children = [];
      -            }
      -        });
      -    },
      -    
      -    /*
      -       Method: getParent
      -    
      -       Returns the parent node of the node having _id_ as id.
      -    
      -       Parameters:
      -    
      -          tree - A JSON tree object. See also <Loader.loadJSON>.
      -          id - The _id_ of the child node whose parent will be returned.
      -
      -      Returns:
      -
      -          A tree JSON node if any, or false otherwise.
      -    
      -    */
      -    getParent: function(tree, id) {
      -        if(tree.id == id) return false;
      -        var ch = tree.children;
      -        if(ch && ch.length > 0) {
      -            for(var i=0; i<ch.length; i++) {
      -                if(ch[i].id == id) 
      -                    return tree;
      -                else {
      -                    var ans = this.getParent(ch[i], id);
      -                    if(ans) return ans;
      -                }
      -            }
      -        }
      -        return false;       
      -    },
      -
      -    /*
      -       Method: getSubtree
      -    
      -       Returns the subtree that matches the given id.
      -    
      -       Parameters:
      -    
      -          tree - A JSON tree object. See also <Loader.loadJSON>.
      -          id - A node *unique* identifier.
      -    
      -       Returns:
      -    
      -          A subtree having a root node matching the given id. Returns null if no subtree matching the id is found.
      -
      -    */
      -    getSubtree: function(tree, id) {
      -        if(tree.id == id) return tree;
      -        for(var i=0, ch=tree.children; i<ch.length; i++) {
      -            var t = this.getSubtree(ch[i], id);
      -            if(t != null) return t;
      -        }
      -        return null;
      -    },
      -
      -    /*
      -       Method: getLeaves
      -    
      -        Returns the leaves of the tree.
      -    
      -       Parameters:
      -    
      -          node - A JSON tree node. See also <Loader.loadJSON>.
      -          maxLevel - _optional_ A subtree's max level.
      -    
      -       Returns:
      -    
      -       An array having objects with two properties. 
      -       
      -        - The _node_ property contains the leaf node. 
      -        - The _level_ property specifies the depth of the node.
      -
      -    */
      -    getLeaves: function (node, maxLevel) {
      -        var leaves = [], levelsToShow = maxLevel || Number.MAX_VALUE;
      -        this.each(node, function(elem, i) {
      -            if(i < levelsToShow && 
      -            (!elem.children || elem.children.length == 0 )) {
      -                leaves.push({
      -                    'node':elem,
      -                    'level':levelsToShow - i
      -                });
      -            }
      -        });
      -        return leaves;
      -    },
      -
      -
      -    /*
      -       Method: eachLevel
      -    
      -        Iterates on tree nodes with relative depth less or equal than a specified level.
      -    
      -       Parameters:
      -    
      -          tree - A JSON tree or subtree. See also <Loader.loadJSON>.
      -          initLevel - An integer specifying the initial relative level. Usually zero.
      -          toLevel - An integer specifying a top level. This method will iterate only through nodes with depth less than or equal this number.
      -          action - A function that receives a node and an integer specifying the actual level of the node.
      -            
      -      Example:
      -     (start code js)
      -       TreeUtil.eachLevel(tree, 0, 3, function(node, depth) {
      -          alert(node.name + ' ' + depth);
      -       });
      -     (end code)
      -    */
      -    eachLevel: function(tree, initLevel, toLevel, action) {
      -        if(initLevel <= toLevel) {
      -            action(tree, initLevel);
      -            for(var i=0, ch = tree.children; i<ch.length; i++) {
      -                this.eachLevel(ch[i], initLevel +1, toLevel, action);   
      -            }
      -        }
      -    },
      -
      -    /*
      -       Method: each
      -    
      -        A tree iterator.
      -    
      -       Parameters:
      -    
      -          tree - A JSON tree or subtree. See also <Loader.loadJSON>.
      -          action - A function that receives a node.
      -
      -      Example:
      -      (start code js)
      -        TreeUtil.each(tree, function(node) {
      -          alert(node.name);
      -        });
      -      (end code)
      -            
      -    */
      -    each: function(tree, action) {
      -        this.eachLevel(tree, 0, Number.MAX_VALUE, action);
      -    },
      -    
      -    /*
      -       Method: loadSubtrees
      -    
      -        Appends subtrees to leaves by requesting new subtrees
      -        with the _request_ method.
      -    
      -       Parameters:
      -    
      -          tree - A JSON tree node. <Loader.loadJSON>.
      -          controller - An object that implements a request method.
      -      
      -       Example:
      -        (start code js)
      -          TreeUtil.loadSubtrees(leafNode, {
      -            request: function(nodeId, level, onComplete) {
      -              //Pseudo-code to make an ajax request for a new subtree
      -              // that has as root id _nodeId_ and depth _level_ ...
      -              Ajax.request({
      -                'url': 'http://subtreerequesturl/',
      -                
      -                onSuccess: function(json) {
      -                  onComplete.onComplete(nodeId, json);
      -                }
      -              });
      -            }
      -          });
      -        (end code)
      -    */
      -    loadSubtrees: function(tree, controller) {
      -        var maxLevel = controller.request && controller.levelsToShow;
      -        var leaves = this.getLeaves(tree, maxLevel),
      -        len = leaves.length,
      -        selectedNode = {};
      -        if(len == 0) controller.onComplete();
      -        for(var i=0, counter=0; i<len; i++) {
      -            var leaf = leaves[i], id = leaf.node.id;
      -            selectedNode[id] = leaf.node;
      -            controller.request(id, leaf.level, {
      -                onComplete: function(nodeId, tree) {
      -                    var ch = tree.children;
      -                    selectedNode[nodeId].children = ch;
      -                    if(++counter == len) {
      -                        controller.onComplete();
      -                    }
      -                }
      -            });
      -        }
      -    }
      -};
      -
      -
      -
      -/*
      - * File: Canvas.js
      - *
      - * A cross browser Canvas widget.
      - *
      - * Used By:
      - *
      - * <ST>, <Hypertree>, <RGraph>
      - */
      -/*
      - Class: Canvas
      - 
      - 	A multi-purpose Canvas Class. This Class can be used with the ExCanvas library to provide
      - cross browser Canvas based visualizations.
      - 
      - Parameters:
      - 
      - id - The canvas id. This id will be used as prefix for the canvas widget DOM elements ids.
      - options - An object containing multiple options such as
      - 
      - - _injectInto_ This property is _required_ and it specifies the id of the DOM element
      - to which the Canvas widget will be appended
      - - _width_ The width of the Canvas widget. Default's to 200px
      - - _height_ The height of the Canvas widget. Default's to 200px
      - - _backgroundColor_ Used for compatibility with IE. The canvas' background color.
      - Default's to '#333'
      - - _styles_ A hash containing canvas specific style properties such as _fillStyle_ and _strokeStyle_ among others.
      - 
      - Example:
      - 
      - Suppose we have this HTML
      - 
      - (start code xml)
      - 	<div id="infovis"></div>
      - (end code)
      - 
      - Now we create a new Canvas instance
      - 
      - (start code js)
      - 	//Create a new canvas instance
      - 	var canvas = new Canvas('mycanvas', {
      - 		//Where to inject the canvas. Any div container will do.
      - 		'injectInto':'infovis',
      -		 //width and height for canvas. Default's to 200.
      -		 'width': 900,
      -		 'height':500,
      -		 //Canvas styles
      -		 'styles': {
      -		 'fillStyle': '#ccddee',
      -		 'strokeStyle': '#772277'
      -		 }
      -	 });
      - (end code)
      -
      - The generated HTML will look like this
      - 
      - (start code xml)
      - <div id="infovis">
      - 	<div id="mycanvas" style="position:relative;">
      - 	<canvas id="mycanvas-canvas" width=900 height=500
      - 	style="position:absolute; top:0; left:0; width:900px; height:500px;" />
      - 	<div id="mycanvas-label"
      - 	style="overflow:visible; position:absolute; top:0; left:0; width:900px; height:0px">
      - 	</div>
      - 	</div>
      - </div>
      - (end code)
      - 
      - As you can see, the generated HTML consists of a canvas DOM element of id _mycanvas-canvas_ and a div label container
      - of id _mycanvas-label_, wrapped in a main div container of id _mycanvas_.
      - You can also add a background canvas, for making background drawings.
      - This is how the <RGraph> background concentric circles are drawn
      - 
      - Example:
      - 
      - (start code js)
      - 	//Create a new canvas instance.
      - 	var canvas = new Canvas('mycanvas', {
      -		//Where to inject the canvas. Any div container will do.
      -		'injectInto':'infovis',
      -		//width and height for canvas. Default's to 200.
      -		'width': 900,
      -		'height':500,
      -		//Canvas styles
      -		'styles': {
      -			'fillStyle': '#ccddee',
      -			'strokeStyle': '#772277'
      -		},
      -		//Add a background canvas for plotting
      -		//concentric circles.
      -		'backgroundCanvas': {
      -			//Add Canvas styles for the bck canvas.
      -			'styles': {
      -				'fillStyle': '#444',
      -				'strokeStyle': '#444'
      -			},
      -			//Add the initialization and plotting functions.
      -			'impl': {
      -				'init': function() {},
      -				'plot': function(canvas, ctx) {
      -					var times = 6, d = 100;
      -					var pi2 = Math.PI*2;
      -					for(var i=1; i<=times; i++) {
      -						ctx.beginPath();
      -						ctx.arc(0, 0, i * d, 0, pi2, true);
      -						ctx.stroke();
      -						ctx.closePath();
      -					}
      -				}
      -			}
      -		}
      -	});
      - (end code)
      - 
      - The _backgroundCanvas_ object contains a canvas _styles_ property and
      - an _impl_ key to be used for implementing background canvas specific code.
      - 
      - The _init_ method is only called once, at the instanciation of the background canvas.
      - The _plot_ method is called for plotting a Canvas image.
      - */
      -this.Canvas = (function(){
      -    var config = {
      -        'injectInto': 'id',
      -        
      -        'width': 200,
      -        'height': 200,
      -        //deprecated
      -        'backgroundColor': '#333333',
      -        
      -        'styles': {
      -            'fillStyle': '#000000',
      -            'strokeStyle': '#000000'
      -        },
      -        
      -        'backgroundCanvas': false
      -    };
      -    
      -    function hasCanvas(){
      -        hasCanvas.t = hasCanvas.t || typeof(HTMLCanvasElement);
      -        return "function" == hasCanvas.t || "object" == hasCanvas.t;
      -    };
      -    
      -    function create(tag, prop, styles){
      -        var elem = document.createElement(tag);
      -        (function(obj, prop){
      -            if (prop) {
      -              for (var p in prop) {
      -                obj[p] = prop[p];
      -              }  
      -            }
      -            return arguments.callee;
      -        })(elem, prop)(elem.style, styles);
      -        //feature check
      -        if (tag == "canvas" && !hasCanvas() && G_vmlCanvasManager) {
      -            elem = G_vmlCanvasManager.initElement(document.body.appendChild(elem));
      -        }
      -        
      -        return elem;
      -    };
      -    
      -    function get(id){
      -        return document.getElementById(id);
      -    };
      -    
      -    function translateToCenter(canvas, ctx, w, h){
      -        var width = w ? (canvas.width - w) : canvas.width;
      -        var height = h ? (canvas.height - h) : canvas.height;
      -        ctx.translate(width / 2, height / 2);
      -    };
      -    
      -    return function(id, opt){
      -        var ctx, bkctx, mainContainer, labelContainer, canvas, bkcanvas;
      -        if (arguments.length < 1) 
      -            throw "Arguments missing";
      -        var idLabel = id + "-label", idCanvas = id + "-canvas", idBCanvas = id + "-bkcanvas";
      -        opt = $merge(config, opt || {});
      -        //create elements
      -        var dim = {
      -            'width': opt.width,
      -            'height': opt.height
      -        };
      -        mainContainer = create("div", {
      -            'id': id
      -        }, $merge(dim, {
      -            'position': 'relative'
      -        }));
      -        labelContainer = create("div", {
      -            'id': idLabel
      -        }, {
      -            'overflow': 'visible',
      -            'position': 'absolute',
      -            'top': 0,
      -            'left': 0,
      -            'width': dim.width + 'px',
      -            'height': 0
      -        });
      -        var dimPos = {
      -            'position': 'absolute',
      -            'top': 0,
      -            'left': 0,
      -            'width': dim.width + 'px',
      -            'height': dim.height + 'px'
      -        };
      -        canvas = create("canvas", $merge({
      -            'id': idCanvas
      -        }, dim), dimPos);
      -        var bc = opt.backgroundCanvas;
      -        if (bc) {
      -            bkcanvas = create("canvas", $merge({
      -                'id': idBCanvas
      -            }, dim), dimPos);
      -            //append elements
      -            mainContainer.appendChild(bkcanvas);
      -        }
      -        mainContainer.appendChild(canvas);
      -        mainContainer.appendChild(labelContainer);
      -        get(opt.injectInto).appendChild(mainContainer);
      -        
      -        //create contexts
      -        ctx = canvas.getContext('2d');
      -        translateToCenter(canvas, ctx);
      -        var st = opt.styles;
      -        var s;
      -        for (s in st) 
      -            ctx[s] = st[s];
      -        if (bc) {
      -            bkctx = bkcanvas.getContext('2d');
      -            st = bc.styles;
      -            for (s in st) {
      -              bkctx[s] = st[s];
      -            }
      -            translateToCenter(bkcanvas, bkctx);
      -            bc.impl.init(bkcanvas, bkctx);
      -            bc.impl.plot(bkcanvas, bkctx);
      -        }
      -        //create methods
      -        return {
      -            'id': id,
      -            /*
      -             Method: getCtx
      -             
      -             Returns the main canvas context object
      -             
      -             Returns:
      -             
      -             Main canvas context
      -             
      -             Example:
      -             
      -             (start code js)
      -             	var ctx = canvas.getCtx();
      -             	//Now I can use the native canvas context
      -             	//and for example change some canvas styles
      -             	ctx.globalAlpha = 1;
      -             (end code)
      -             */
      -            getCtx: function(){
      -                return ctx;
      -            },
      -            
      -            /*
      -             Method: getElement
      -             Returns the main Canvas DOM wrapper
      -             
      -             Returns:
      -             DOM canvas wrapper generated, (i.e the div wrapper element with id _mycanvas_)
      -             
      -             Example:
      -             (start code js)
      -             	var wrapper = canvas.getElement();
      -             	//Returns <div id="mycanvas" ... >...</div> as element
      -             (end code)
      -             */
      -            getElement: function(){
      -                return mainContainer;
      -            },
      -            
      -            /*
      -             Method: resize
      -             
      -             Resizes the canvas.
      -             
      -             Parameters:
      -             
      -             width - New canvas width.
      -             height - New canvas height.
      -             
      -             This method can be used with the <ST>, <Hypertree> or <RGraph> visualizations to resize
      -             the visualizations
      -             
      -             Example:
      -             
      -             (start code js)
      -             	function resizeViz(width, height) {
      -             		canvas.resize(width, height);
      -             		rgraph.refresh(); //ht.refresh or st.refresh() also work.
      -             		rgraph.onAfterCompute();
      -             	}
      -             (end code)
      -             
      -             */
      -            resize: function(width, height){
      -                var pwidth = canvas.width, pheight = canvas.height;
      -            	canvas.width = width;
      -                canvas.height = height;
      -                canvas.style.width = width + "px";
      -                canvas.style.height = height + "px";
      -                if (bc) {
      -                    bkcanvas.width = width;
      -                    bkcanvas.height = height;
      -                    bkcanvas.style.width = width + "px";
      -                    bkcanvas.style.height = height + "px";
      -                }
      -                //small ExCanvas fix
      -                if(!hasCanvas()) {
      -                	translateToCenter(canvas, ctx, pwidth, pheight);
      -                } else {
      -                	translateToCenter(canvas, ctx);
      -                }
      -                
      -                var st = opt.styles;
      -                var s;
      -                for (s in st) {
      -                  ctx[s] = st[s];
      -                }
      -                if (bc) {
      -                    st = bc.styles;
      -                    for (s in st) 
      -                        bkctx[s] = st[s];
      -                    //same ExCanvas fix here
      -                    if(!hasCanvas()) {
      -                    	translateToCenter(bkcanvas, bkctx, pwidth, pheight);
      -                    } else {
      -                    	translateToCenter(bkcanvas, bkctx);	
      -                    }
      -                    
      -                    bc.impl.init(bkcanvas, bkctx);
      -                    bc.impl.plot(bkcanvas, bkctx);
      -                }
      -            },
      -            
      -            /*
      -             Method: getSize
      -             
      -             Returns canvas dimensions.
      -             
      -             Returns:
      -             
      -             An object with _width_ and _height_ properties.
      -             Example:
      -             (start code js)
      -             canvas.getSize(); //returns { width: 900, height: 500 }
      -             (end code)
      -             */
      -            getSize: function(){
      -                return {
      -                    'width': canvas.width,
      -                    'height': canvas.height
      -                };
      -            },
      -            
      -            path: function(type, action){
      -                ctx.beginPath();
      -                action(ctx);
      -                ctx[type]();
      -                ctx.closePath();
      -            },
      -            
      -            /*
      -             Method: clear
      -             
      -             Clears the canvas object.
      -             */
      -            clear: function(){
      -                var size = this.getSize();
      -                ctx.clearRect(-size.width / 2, -size.height / 2, size.width, size.height);
      -            },
      -            
      -            /*
      -             Method: clearReactangle
      -             
      -             Same as <Canvas.clear> but only clears a section of the canvas.
      -             
      -             Parameters:
      -             
      -             top - An integer specifying the top of the rectangle.
      -             right -  An integer specifying the right of the rectangle.
      -             bottom - An integer specifying the bottom of the rectangle.
      -             left - An integer specifying the left of the rectangle.
      -             */
      -            clearRectangle: function(top, right, bottom, left){
      -                //if using excanvas
      -                if (!hasCanvas()) {
      -                    var f0 = ctx.fillStyle;
      -                    ctx.fillStyle = opt.backgroundColor;
      -                    ctx.fillRect(left, top, Math.abs(right - left), Math.abs(bottom - top));
      -                    ctx.fillStyle = f0;
      -                }
      -                else {
      -                    ctx.clearRect(left, top, Math.abs(right - left), Math.abs(bottom - top));
      -                }
      -            }
      -        };
      -    };
      -    
      -})();
      -
      -
      -
      -/*
      - * File: Polar.js
      - * 
      - * Defines the <Polar> class.
      - *
      - * Description:
      - *
      - * The <Polar> class, just like the <Complex> class, is used by the <Hypertree>, <ST> and <RGraph> as a 2D point representation.
      - *
      - * See also:
      - *
      - * <http://en.wikipedia.org/wiki/Polar_coordinates>
      - *
      -*/
      -
      -/*
      -   Class: Polar
      -
      -   A multi purpose polar representation.
      -
      -   Description:
      - 
      -   The <Polar> class, just like the <Complex> class, is used by the <Hypertree>, <ST> and <RGraph> as a 2D point representation.
      - 
      -   See also:
      - 
      -   <http://en.wikipedia.org/wiki/Polar_coordinates>
      - 
      -   Parameters:
      -
      -      theta - An angle.
      -      rho - The norm.
      -*/
      -
      -this.Polar = function(theta, rho) {
      -  this.theta = theta;
      -  this.rho = rho;
      -};
      -
      -Polar.prototype = {
      -    /*
      -       Method: getc
      -    
      -       Returns a complex number.
      -    
      -       Parameters:
      -
      -       simple - _optional_ If *true*, this method will return only an object holding x and y properties and not a <Complex> instance. Default's *false*.
      -
      -      Returns:
      -    
      -          A complex number.
      -    */
      -    getc: function(simple) {
      -        return this.toComplex(simple);
      -    },
      -
      -    /*
      -       Method: getp
      -    
      -       Returns a <Polar> representation.
      -    
      -       Returns:
      -    
      -          A variable in polar coordinates.
      -    */
      -    getp: function() {
      -        return this;
      -    },
      -
      -
      -    /*
      -       Method: set
      -    
      -       Sets a number.
      -
      -       Parameters:
      -
      -       v - A <Complex> or <Polar> instance.
      -    
      -    */
      -    set: function(v) {
      -        v = v.getp();
      -        this.theta = v.theta; this.rho = v.rho;
      -    },
      -
      -    /*
      -       Method: setc
      -    
      -       Sets a <Complex> number.
      -
      -       Parameters:
      -
      -       x - A <Complex> number real part.
      -       y - A <Complex> number imaginary part.
      -    
      -    */
      -    setc: function(x, y) {
      -        this.rho = Math.sqrt(x * x + y * y);
      -        this.theta = Math.atan2(y, x);
      -        if(this.theta < 0) this.theta += Math.PI * 2;
      -    },
      -
      -    /*
      -       Method: setp
      -    
      -       Sets a polar number.
      -
      -       Parameters:
      -
      -       theta - A <Polar> number angle property.
      -       rho - A <Polar> number rho property.
      -    
      -    */
      -    setp: function(theta, rho) {
      -        this.theta = theta; 
      -        this.rho = rho;
      -    },
      -
      -    /*
      -       Method: clone
      -    
      -       Returns a copy of the current object.
      -    
      -       Returns:
      -    
      -          A copy of the real object.
      -    */
      -    clone: function() {
      -        return new Polar(this.theta, this.rho);
      -    },
      -
      -    /*
      -       Method: toComplex
      -    
      -        Translates from polar to cartesian coordinates and returns a new <Complex> instance.
      -    
      -        Parameters:
      -
      -        simple - _optional_ If *true* this method will only return an object with x and y properties (and not the whole <Complex> instance). Default's *false*.
      - 
      -        Returns:
      -    
      -          A new <Complex> instance.
      -    */
      -    toComplex: function(simple) {
      -        var x = Math.cos(this.theta) * this.rho;
      -        var y = Math.sin(this.theta) * this.rho;
      -        if(simple) return { 'x': x, 'y': y};
      -        return new Complex(x, y);
      -    },
      -
      -    /*
      -       Method: add
      -    
      -        Adds two <Polar> instances.
      -    
      -       Parameters:
      -
      -       polar - A <Polar> number.
      -
      -       Returns:
      -    
      -          A new Polar instance.
      -    */
      -    add: function(polar) {
      -        return new Polar(this.theta + polar.theta, this.rho + polar.rho);
      -    },
      -    
      -    /*
      -       Method: scale
      -    
      -        Scales a polar norm.
      -    
      -        Parameters:
      -
      -        number - A scale factor.
      -        
      -        Returns:
      -    
      -          A new Polar instance.
      -    */
      -    scale: function(number) {
      -        return new Polar(this.theta, this.rho * number);
      -    },
      -    
      -    /*
      -       Method: equals
      -    
      -       Comparison method.
      -
      -       Returns *true* if the theta and rho properties are equal.
      -
      -       Parameters:
      -
      -       c - A <Polar> number.
      -
      -       Returns:
      -
      -       *true* if the theta and rho parameters for these objects are equal. *false* otherwise.
      -    */
      -    equals: function(c) {
      -        return this.theta == c.theta && this.rho == c.rho;
      -    },
      -    
      -    /*
      -       Method: $add
      -    
      -        Adds two <Polar> instances affecting the current object.
      -    
      -       Paramters:
      -
      -       polar - A <Polar> instance.
      -
      -       Returns:
      -    
      -          The changed object.
      -    */
      -    $add: function(polar) {
      -        this.theta = this.theta + polar.theta; this.rho += polar.rho;
      -        return this;
      -    },
      -
      -    /*
      -       Method: $madd
      -    
      -        Adds two <Polar> instances affecting the current object. The resulting theta angle is modulo 2pi.
      -    
      -       Parameters:
      -
      -       polar - A <Polar> instance.
      -
      -       Returns:
      -    
      -          The changed object.
      -    */
      -    $madd: function(polar) {
      -        this.theta = (this.theta + polar.theta) % (Math.PI * 2); this.rho += polar.rho;
      -        return this;
      -    },
      -
      -    
      -    /*
      -       Method: $scale
      -    
      -        Scales a polar instance affecting the object.
      -    
      -      Parameters:
      -
      -      number - A scaling factor.
      -
      -      Returns:
      -    
      -          The changed object.
      -    */
      -    $scale: function(number) {
      -        this.rho *= number;
      -        return this;
      -    },
      -    
      -    /*
      -       Method: interpolate
      -    
      -        Calculates a polar interpolation between two points at a given delta moment.
      -
      -        Parameters:
      -      
      -        elem - A <Polar> instance.
      -        delta - A delta factor ranging [0, 1].
      -    
      -       Returns:
      -    
      -          A new <Polar> instance representing an interpolation between _this_ and _elem_
      -    */
      -    interpolate: function(elem, delta) {
      -        var pi = Math.PI, pi2 = pi * 2;
      -        var ch = function(t) {
      -            return (t < 0)? (t % pi2) + pi2 : t % pi2;
      -        };
      -        var tt = this.theta, et = elem.theta;
      -        var sum;
      -        if(Math.abs(tt - et) > pi) {
      -            if(tt > et) {
      -                sum =ch((et + ((tt - pi2) - et) * delta)) ;
      -            } else {
      -                sum =ch((et - pi2 + (tt - (et - pi2)) * delta));
      -            }
      -        } else {
      -            sum =ch((et + (tt - et) * delta)) ;
      -        }
      -        var r = (this.rho - elem.rho) * delta + elem.rho;
      -        return {
      -            'theta': sum,
      -            'rho': r
      -        };
      -    }
      -};
      -
      -
      -var $P = function(a, b) { return new Polar(a, b); };
      -
      -Polar.KER = $P(0, 0);
      -
      -
      -
      -/*
      - * File: Complex.js
      - * 
      - * Defines the <Complex> class.
      - *
      - * Description:
      - *
      - * The <Complex> class, just like the <Polar> class, is used by the <Hypertree>, <ST> and <RGraph> as a 2D point representation.
      - *
      - * See also:
      - *
      - * <http://en.wikipedia.org/wiki/Complex_number>
      - *
      -*/
      -
      -/*
      -   Class: Complex
      -    
      -   A multi-purpose Complex Class with common methods.
      - 
      -   Description:
      - 
      -   The <Complex> class, just like the <Polar> class, is used by the <Hypertree>, <ST> and <RGraph> as a 2D point representation.
      - 
      -   See also:
      - 
      -   <http://en.wikipedia.org/wiki/Complex_number>
      -
      -   Parameters:
      -
      -   x - _optional_ A Complex number real part.
      -   y - _optional_ A Complex number imaginary part.
      - 
      -*/
      -
      -this.Complex = function(x, y) {
      -  this.x = x;
      -  this.y = y;
      -};
      -
      -Complex.prototype = {
      -    /*
      -       Method: getc
      -    
      -       Returns a complex number.
      -    
      -       Returns:
      -    
      -          A complex number.
      -    */
      -    getc: function() {
      -        return this;
      -    },
      -
      -    /*
      -       Method: getp
      -    
      -       Returns a <Polar> representation of this number.
      -    
      -       Parameters:
      -
      -       simple - _optional_ If *true*, this method will return only an object holding theta and rho properties and not a <Polar> instance. Default's *false*.
      -
      -       Returns:
      -    
      -          A variable in <Polar> coordinates.
      -    */
      -    getp: function(simple) {
      -        return this.toPolar(simple);
      -    },
      -
      -
      -    /*
      -       Method: set
      -    
      -       Sets a number.
      -
      -       Parameters:
      -
      -       c - A <Complex> or <Polar> instance.
      -    
      -    */
      -    set: function(c) {
      -        c = c.getc(true);
      -        this.x = c.x; 
      -    this.y = c.y;
      -    },
      -
      -    /*
      -       Method: setc
      -    
      -       Sets a complex number.
      -
      -       Parameters:
      -
      -       x - A <Complex> number Real part.
      -       y - A <Complex> number Imaginary part.
      -    
      -    */
      -    setc: function(x, y) {
      -        this.x = x; 
      -        this.y = y;
      -    },
      -
      -    /*
      -       Method: setp
      -    
      -       Sets a polar number.
      -
      -       Parameters:
      -
      -       theta - A <Polar> number theta property.
      -       rho - A <Polar> number rho property.
      -    
      -    */
      -    setp: function(theta, rho) {
      -        this.x = Math.cos(theta) * rho;
      -        this.y = Math.sin(theta) * rho;
      -    },
      -
      -    /*
      -       Method: clone
      -    
      -       Returns a copy of the current object.
      -    
      -       Returns:
      -    
      -          A copy of the real object.
      -    */
      -    clone: function() {
      -        return new Complex(this.x, this.y);
      -    },
      -
      -    /*
      -       Method: toPolar
      -    
      -       Transforms cartesian to polar coordinates.
      -    
      -       Parameters:
      -
      -       simple - _optional_ If *true* this method will only return an object with theta and rho properties (and not the whole <Polar> instance). Default's *false*.
      -       
      -       Returns:
      -    
      -          A new <Polar> instance.
      -    */
      -    
      -    toPolar: function(simple) {
      -        var rho = this.norm();
      -        var atan = Math.atan2(this.y, this.x);
      -        if(atan < 0) atan += Math.PI * 2;
      -        if(simple) return { 'theta': atan, 'rho': rho };
      -        return new Polar(atan, rho);
      -    },
      -    /*
      -       Method: norm
      -    
      -       Calculates a <Complex> number norm.
      -    
      -       Returns:
      -    
      -          A real number representing the complex norm.
      -    */
      -    norm: function () {
      -        return Math.sqrt(this.squaredNorm());
      -    },
      -    
      -    /*
      -       Method: squaredNorm
      -    
      -       Calculates a <Complex> number squared norm.
      -    
      -       Returns:
      -    
      -          A real number representing the complex squared norm.
      -    */
      -    squaredNorm: function () {
      -        return this.x*this.x + this.y*this.y;
      -    },
      -
      -    /*
      -       Method: add
      -    
      -       Returns the result of adding two complex numbers.
      -       
      -       Does not alter the original object.
      -
      -       Parameters:
      -    
      -          pos - A <Complex> instance.
      -    
      -       Returns:
      -    
      -         The result of adding two complex numbers.
      -    */
      -    add: function(pos) {
      -        return new Complex(this.x + pos.x, this.y + pos.y);
      -    },
      -
      -    /*
      -       Method: prod
      -    
      -       Returns the result of multiplying two <Complex> numbers.
      -       
      -       Does not alter the original object.
      -
      -       Parameters:
      -    
      -          pos - A <Complex> instance.
      -    
      -       Returns:
      -    
      -         The result of multiplying two complex numbers.
      -    */
      -    prod: function(pos) {
      -        return new Complex(this.x*pos.x - this.y*pos.y, this.y*pos.x + this.x*pos.y);
      -    },
      -
      -    /*
      -       Method: conjugate
      -    
      -       Returns the conjugate of this <Complex> number.
      -
      -       Does not alter the original object.
      -
      -       Returns:
      -    
      -         The conjugate of this <Complex> number.
      -    */
      -    conjugate: function() {
      -        return new Complex(this.x, -this.y);
      -    },
      -
      -
      -    /*
      -       Method: scale
      -    
      -       Returns the result of scaling a <Complex> instance.
      -       
      -       Does not alter the original object.
      -
      -       Parameters:
      -    
      -          factor - A scale factor.
      -    
      -       Returns:
      -    
      -         The result of scaling this complex to a factor.
      -    */
      -    scale: function(factor) {
      -        return new Complex(this.x * factor, this.y * factor);
      -    },
      -
      -    /*
      -       Method: equals
      -    
      -       Comparison method.
      -
      -       Returns *true* if both real and imaginary parts are equal.
      -
      -       Parameters:
      -
      -       c - A <Complex> instance.
      -
      -       Returns:
      -
      -       A boolean instance indicating if both <Complex> numbers are equal.
      -    */
      -    equals: function(c) {
      -        return this.x == c.x && this.y == c.y;
      -    },
      -
      -    /*
      -       Method: $add
      -    
      -       Returns the result of adding two <Complex> numbers.
      -       
      -       Alters the original object.
      -
      -       Parameters:
      -    
      -          pos - A <Complex> instance.
      -    
      -       Returns:
      -    
      -         The result of adding two complex numbers.
      -    */
      -    $add: function(pos) {
      -        this.x += pos.x; this.y += pos.y;
      -        return this;    
      -    },
      -    
      -    /*
      -       Method: $prod
      -    
      -       Returns the result of multiplying two <Complex> numbers.
      -       
      -       Alters the original object.
      -
      -       Parameters:
      -    
      -          pos - A <Complex> instance.
      -    
      -       Returns:
      -    
      -         The result of multiplying two complex numbers.
      -    */
      -    $prod:function(pos) {
      -        var x = this.x, y = this.y;
      -        this.x = x*pos.x - y*pos.y;
      -        this.y = y*pos.x + x*pos.y;
      -        return this;
      -    },
      -    
      -    /*
      -       Method: $conjugate
      -    
      -       Returns the conjugate for this <Complex>.
      -       
      -       Alters the original object.
      -
      -       Returns:
      -    
      -         The conjugate for this complex.
      -    */
      -    $conjugate: function() {
      -        this.y = -this.y;
      -        return this;
      -    },
      -    
      -    /*
      -       Method: $scale
      -    
      -       Returns the result of scaling a <Complex> instance.
      -       
      -       Alters the original object.
      -
      -       Parameters:
      -    
      -          factor - A scale factor.
      -    
      -       Returns:
      -    
      -         The result of scaling this complex to a factor.
      -    */
      -    $scale: function(factor) {
      -        this.x *= factor; this.y *= factor;
      -        return this;
      -    },
      -    
      -    /*
      -       Method: $div
      -    
      -       Returns the division of two <Complex> numbers.
      -       
      -       Alters the original object.
      -
      -       Parameters:
      -    
      -          pos - A <Complex> number.
      -    
      -       Returns:
      -    
      -         The result of scaling this complex to a factor.
      -    */
      -    $div: function(pos) {
      -        var x = this.x, y = this.y;
      -        var sq = pos.squaredNorm();
      -        this.x = x * pos.x + y * pos.y; this.y = y * pos.x - x * pos.y;
      -        return this.$scale(1 / sq);
      -    }
      -};
      -
      -var $C = function(a, b) { return new Complex(a, b); };
      -
      -Complex.KER = $C(0, 0);
      -
      -
      -
      -/*
      - * File: Graph.js
      - *
      - * Generic <Graph>, <Graph.Node> and <Graph.Adjacence> classes.
      - *
      - * Used by:
      - *
      - * <Hypertree>, <RGraph> and <ST>.
      - *
      -*/
      -
      -/*
      - Class: Graph
      -
      - A generic Graph class.
      -
      - Description:
      -
      - When a json graph/tree structure is loaded by <Loader.loadJSON>, an internal <Graph> representation is created. 
      -
      - In most cases you'll be dealing with an already created <Graph> structure, so methods like <Graph.addNode> or <Graph.addAdjacence> won't 
      - be of many use. However methods like <Graph.getNode> and <Graph.hasNode> are pretty useful.
      -
      - <Graph.Util> provides also iterators for <Graphs> and advanced and useful graph operations and methods.
      -
      - Used by:
      -
      - <Loader.loadJSON>, <Hypertree>, <RGraph> and <ST>.
      -
      - Access:
      -
      - An instance of this class can be accessed by using the _graph_ parameter of a <Hypertree>, <RGraph> or <ST> instance
      -
      - Example:
      -
      - (start code js)
      -   var st = new ST(canvas, config);
      -   st.graph.getNode //or any other <Graph> method.
      -   
      -   var ht = new Hypertree(canvas, config);
      -   ht.graph.getNode //or any other <Graph> method.
      -   
      -   var rg = new RGraph(canvas, config);
      -   rg.graph.getNode //or any other <Graph> method.
      - (end code)
      - 
      -*/  
      -
      -this.Graph = new Class({
      -
      - initialize: function(opt) {
      -    var innerOptions = {
      -    'complex': false,
      -    'Node': {}
      -  };
      -    this.opt = $merge(innerOptions, opt || {});
      -    this.nodes= {};
      - },
      -
      -/*
      -     Method: getNode
      -    
      -     Returns a <Graph.Node> by _id_.
      -
      -     Parameters:
      -
      -     id - A <Graph.Node> id.
      -
      -     Returns:
      -
      -     A <Graph.Node> having _id_ as id. Returns *false* otherwise.
      -
      -     Example:
      -
      -     (start code js)
      -       var node = graph.getNode('someid');
      -     (end code)
      -*/  
      - getNode: function(id) {
      -    if(this.hasNode(id)) return this.nodes[id];
      -    return false;
      - },
      -
      -/*
      -     Method: getAdjacence
      -    
      -     Returns an array of <Graph.Adjacence> objects connecting nodes with ids _id_ and _id2_.
      -
      -     Parameters:
      -
      -     id - A <Graph.Node> id.
      -     id2 - A <Graph.Node> id.
      -
      -     Returns:
      -
      -     An Array of <Graph.Adjacence> objects. Returns *false* if there's not a <Graph.Adjacence> connecting those two nodes.
      -*/  
      -  getAdjacence: function (id, id2) {
      -    var adjs = [];
      -    if(this.hasNode(id)     && this.hasNode(id2) 
      -    && this.nodes[id].adjacentTo({ 'id':id2 }) && this.nodes[id2].adjacentTo({ 'id':id })) {
      -        adjs.push(this.nodes[id].getAdjacency(id2));
      -        adjs.push(this.nodes[id2].getAdjacency(id));
      -        return adjs;
      -    }
      -    return false;   
      - },
      -
      -    /*
      -     Method: addNode
      -    
      -     Adds a node.
      -     
      -     Parameters:
      -    
      -        obj - An object containing as properties
      -
      -        - _id_ node's id
      -        - _name_ node's name
      -        - _data_ node's data hash
      -
      -    See also:
      -    <Graph.Node>
      -
      -  */  
      -  addNode: function(obj) {
      -    if(!this.nodes[obj.id]) {
      -        this.nodes[obj.id] = new Graph.Node($extend({
      -      'id': obj.id,
      -      'name': obj.name,
      -      'data': obj.data
      -    }, this.opt.Node), this.opt.complex);
      -    }
      -    return this.nodes[obj.id];
      -  },
      -  
      -    /*
      -     Method: addAdjacence
      -    
      -     Connects nodes specified by _obj_ and _obj2_. If not found, nodes are created.
      -     
      -     Parameters:
      -    
      -        obj - a <Graph.Node> object.
      -        obj2 - Another <Graph.Node> object.
      -        data - A DataSet object. Used to store some extra information in the <Graph.Adjacence> object created.
      -
      -    See also:
      -
      -    <Graph.Node>, <Graph.Adjacence>
      -    */  
      -  addAdjacence: function (obj, obj2, data) {
      -    var adjs = [];
      -    if(!this.hasNode(obj.id)) { this.addNode(obj); }
      -    if(!this.hasNode(obj2.id)) { this.addNode(obj2); }
      -    obj = this.nodes[obj.id]; obj2 = this.nodes[obj2.id];
      -    
      -    for(var i in this.nodes) {
      -        if(this.nodes[i].id == obj.id) {
      -            if(!this.nodes[i].adjacentTo(obj2)) {
      -                adjs.push(this.nodes[i].addAdjacency(obj2, data));
      -            }
      -        }
      -        
      -        if(this.nodes[i].id == obj2.id) {   
      -            if(!this.nodes[i].adjacentTo(obj)) {
      -                adjs.push(this.nodes[i].addAdjacency(obj, data));
      -            }
      -        }
      -    }
      -    return adjs;
      - },
      -
      -    /*
      -     Method: removeNode
      -    
      -     Removes a <Graph.Node> matching the specified _id_.
      -
      -     Parameters:
      -
      -     id - A node's id.
      -
      -    */  
      -  removeNode: function(id) {
      -    if(this.hasNode(id)) {
      -        var node = this.nodes[id];
      -        for(var i=0 in node.adjacencies) {
      -            var adj = node.adjacencies[i];
      -            this.removeAdjacence(id, adj.nodeTo.id);
      -        }
      -        delete this.nodes[id];
      -    }
      -  },
      -  
      -/*
      -     Method: removeAdjacence
      -    
      -     Removes a <Graph.Adjacence> matching _id1_ and _id2_.
      -
      -     Parameters:
      -
      -     id1 - A <Graph.Node> id.
      -     id2 - A <Graph.Node> id.
      -*/  
      -  removeAdjacence: function(id1, id2) {
      -    if(this.hasNode(id1)) this.nodes[id1].removeAdjacency(id2);
      -    if(this.hasNode(id2)) this.nodes[id2].removeAdjacency(id1);
      -  },
      -
      -    /*
      -     Method: hasNode
      -    
      -     Returns a Boolean instance indicating if the node belongs to the <Graph> or not.
      -     
      -     Parameters:
      -    
      -        id - Node id.
      -
      -     Returns:
      -      
      -     A Boolean instance indicating if the node belongs to the graph or not.
      -    */  
      -  hasNode: function(id) {
      -    return id in this.nodes;
      -  }
      -});
      -
      -/*
      -     Class: Graph.Node
      -
      -     A <Graph> node.
      -
      -     Parameters:
      -
      -     obj - An object containing an 'id', 'name' and 'data' properties as described in <Graph.addNode>.
      -     complex - Whether node position properties should contain <Complex> or <Polar> instances.
      -
      -     See also:
      -
      -     <Graph>
      -
      -     Description:
      -
      -     An instance of <Graph.Node> is usually passed as parameter for most configuration/controller methods in the 
      -     <Hypertree>, <RGraph> and <ST> classes.
      -
      -     A <Graph.Node> object has as properties
      -
      -      id - Node id.
      -      name - Node name.
      -      data - Node data property containing a hash (i.e {}) with custom options. For more information see <Loader.loadJSON>.
      -      selected - Whether the node is selected or not. Used by <ST> for selecting nodes that are between the root node and the selected node.
      -      angleSpan - For radial layouts such as the ones performed by the <Hypertree> and the <RGraph>. Contains _begin_ and _end_ properties containing angle values describing the angle span for this subtree.
      -      alpha - Current opacity value.
      -      startAlpha - Opacity begin value. Used for interpolation.
      -      endAlpha - Opacity end value. Used for interpolation.
      -      pos - Current position. Can be a <Complex> or <Polar> instance.
      -      startPos - Starting position. Used for interpolation.
      -      endPos - Ending position. Used for interpolation.
      -*/
      -Graph.Node = new Class({
      -    
      -    initialize: function(opt, complex) {
      -    var innerOptions = {
      -      'id': '',
      -      'name': '',
      -      'data': {},
      -      'adjacencies': {},
      -
      -      'selected': false,
      -      'drawn': false,
      -      'exist': false,
      -
      -      'angleSpan': {
      -        'begin': 0,
      -        'end' : 0
      -      },
      -
      -      'alpha': 1,
      -      'startAlpha': 1,
      -      'endAlpha': 1,
      -      
      -      'pos': (complex && $C(0, 0)) || $P(0, 0),
      -      'startPos': (complex && $C(0, 0)) || $P(0, 0),
      -      'endPos': (complex && $C(0, 0)) || $P(0, 0)
      -    };
      -    
      -    $extend(this, $extend(innerOptions, opt));
      -  },
      -
      -    /*
      -       Method: adjacentTo
      -    
      -       Indicates if the node is adjacent to the node specified by id
      -
      -       Parameters:
      -    
      -          id - A node id.
      -    
      -       Returns:
      -    
      -         A Boolean instance indicating whether this node is adjacent to the specified by id or not.
      -
      -       Example:
      -       (start code js)
      -        node.adjacentTo('mynodeid');
      -       (end code)
      -    */
      -    adjacentTo: function(node) {
      -        return node.id in this.adjacencies;
      -    },
      -
      -    /*
      -       Method: getAdjacency
      -    
      -       Returns a <Graph.Adjacence> object connecting the current <Graph.Node> and the node having _id_ as id.
      -
      -       Parameters:
      -    
      -          id - A node id.
      -
      -       Returns:
      -
      -          A <Graph.Adjacence> object or undefined.
      -    */  
      -    getAdjacency: function(id) {
      -        return this.adjacencies[id];
      -    },
      -    /*
      -       Method: addAdjacency
      -    
      -       Connects the current node and the given node.
      -
      -       Parameters:
      -    
      -          node - A <Graph.Node>.
      -          data - Some custom hash information.
      -    */  
      -    addAdjacency: function(node, data) {
      -        var adj = new Graph.Adjacence(this, node, data);
      -        return this.adjacencies[node.id] = adj;
      -    },
      -    
      -    /*
      -       Method: removeAdjacency
      -    
      -       Removes a <Graph.Adjacence> by _id_.
      -
      -       Parameters:
      -    
      -          id - A node id.
      -    */  
      -    removeAdjacency: function(id) {
      -        delete this.adjacencies[id];
      -    }
      -});
      -
      -/*
      -     Class: Graph.Adjacence
      -
      -     A <Graph> adjacence (or edge). Connects two <Graph.Nodes>.
      -
      -     Parameters:
      -
      -     nodeFrom - A <Graph.Node>.
      -     nodeTo - A <Graph.Node>.
      -     data - Some custom hash data.
      -
      -     See also:
      -
      -     <Graph>
      -
      -     Description:
      -
      -     An instance of <Graph.Adjacence> is usually passed as parameter for some configuration/controller methods in the 
      -     <Hypertree>, <RGraph> and <ST> classes.
      -
      -     A <Graph.Adjacence> object has as properties
      -
      -      nodeFrom - A <Graph.Node> connected by this edge.
      -      nodeTo - Another  <Graph.Node> connected by this edge.
      -      data - Node data property containing a hash (i.e {}) with custom options. For more information see <Loader.loadJSON>.
      -      alpha - Current opacity value.
      -      startAlpha - Opacity begin value. Used for interpolation.
      -      endAlpha - Opacity end value. Used for interpolation.
      -*/
      -Graph.Adjacence = function(nodeFrom, nodeTo, data) {
      -    this.nodeFrom = nodeFrom;
      -    this.nodeTo = nodeTo;
      -    this.data = data || {};
      -    this.alpha = 1;
      -    this.startAlpha = 1;
      -    this.endAlpha = 1;
      -};
      -
      -/*
      -   Object: Graph.Util
      -
      -   <Graph> traversal and processing utility object.
      -*/
      -Graph.Util = {
      -    /*
      -       filter
      -    
      -       For internal use only. Provides a filtering function based on flags.
      -    */
      -    filter: function(param) {
      -        if(!param || !($type(param) == 'string')) return function() { return true; };
      -        var props = param.split(" ");
      -        return function(elem) {
      -            for(var i=0; i<props.length; i++) { 
      -              if(elem[props[i]]) { 
      -                return false; 
      -              }
      -            }
      -            return true;
      -        };
      -    },
      -    /*
      -       Method: getNode
      -    
      -       Returns a <Graph.Node> by _id_.
      -
      -       Parameters:
      -
      -       graph - A <Graph> instance.
      -       id - A <Graph.Node> id.
      -
      -       Returns:
      -
      -       A <Graph> node.
      -
      -       Example:
      -
      -       (start code js)
      -         Graph.Util.getNode(graph, 'nodeid');
      -       (end code)
      -    */
      -    getNode: function(graph, id) {
      -        return graph.getNode(id);
      -    },
      -    
      -    /*
      -       Method: eachNode
      -    
      -       Iterates over <Graph> nodes performing an _action_.
      -
      -       Parameters:
      -
      -       graph - A <Graph> instance.
      -       action - A callback function having a <Graph.Node> as first formal parameter.
      -
      -       Example:
      -       (start code js)
      -         Graph.Util.each(graph, function(node) {
      -          alert(node.name);
      -         });
      -       (end code)
      -    */
      -    eachNode: function(graph, action, flags) {
      -        var filter = this.filter(flags);
      -        for(var i in graph.nodes) {
      -          if(filter(graph.nodes[i])) action(graph.nodes[i]);
      -        } 
      -    },
      -    
      -    /*
      -       Method: eachAdjacency
      -    
      -       Iterates over <Graph.Node> adjacencies applying the _action_ function.
      -
      -       Parameters:
      -
      -       node - A <Graph.Node>.
      -       action - A callback function having <Graph.Adjacence> as first formal parameter.
      -
      -       Example:
      -       (start code js)
      -         Graph.Util.eachAdjacency(node, function(adj) {
      -          alert(adj.nodeTo.name);
      -         });
      -       (end code)
      -    */
      -    eachAdjacency: function(node, action, flags) {
      -        var adj = node.adjacencies, filter = this.filter(flags);
      -        for(var id in adj) {
      -          if(filter(adj[id])) {
      -            action(adj[id], id);
      -          }
      -        }
      -    },
      -
      -     /*
      -       Method: computeLevels
      -    
      -       Performs a BFS traversal setting the correct depth for each node.
      -
      -       The depth of each node can then be accessed by 
      -       >node._depth
      -
      -       Parameters:
      -
      -       graph - A <Graph>.
      -       id - A starting node id for the BFS traversal.
      -       startDepth - _optional_ A minimum depth value. Default's 0.
      -
      -    */
      -    computeLevels: function(graph, id, startDepth, flags) {
      -        startDepth = startDepth || 0;
      -        var filter = this.filter(flags);
      -        this.eachNode(graph, function(elem) {
      -            elem._flag = false;
      -            elem._depth = -1;
      -        }, flags);
      -    var root = graph.getNode(id);
      -        root._depth = startDepth;
      -        var queue = [root];
      -        while(queue.length != 0) {
      -            var node = queue.pop();
      -            node._flag = true;
      -            this.eachAdjacency(node, function(adj) {
      -                var n = adj.nodeTo;
      -                if(n._flag == false && filter(n)) {
      -                    if(n._depth < 0) n._depth = node._depth + 1 + startDepth;
      -                    queue.unshift(n);
      -                }
      -            }, flags);
      -        }
      -    },
      -
      -    /*
      -       Method: eachBFS
      -    
      -       Performs a BFS traversal applying _action_ to each <Graph.Node>.
      -
      -       Parameters:
      -
      -       graph - A <Graph>.
      -       id - A starting node id for the BFS traversal.
      -       action - A callback function having a <Graph.Node> as first formal parameter.
      -
      -       Example:
      -       (start code js)
      -         Graph.Util.eachBFS(graph, 'mynodeid', function(node) {
      -          alert(node.name);
      -         });
      -       (end code)
      -    */
      -    eachBFS: function(graph, id, action, flags) {
      -        var filter = this.filter(flags);
      -        this.clean(graph);
      -        var queue = [graph.getNode(id)];
      -        while(queue.length != 0) {
      -            var node = queue.pop();
      -            node._flag = true;
      -            action(node, node._depth);
      -            this.eachAdjacency(node, function(adj) {
      -                var n = adj.nodeTo;
      -                if(n._flag == false && filter(n)) {
      -                    n._flag = true;
      -                    queue.unshift(n);
      -                }
      -            }, flags);
      -        }
      -    },
      -    
      -    /*
      -       Method: eachLevel
      -    
      -       Iterates over a node's subgraph applying _action_ to the nodes of relative depth between _levelBegin_ and _levelEnd_.
      -
      -       Parameters:
      -       
      -       node - A <Graph.Node>.
      -       levelBegin - A relative level value.
      -       levelEnd - A relative level value.
      -       action - A callback function having a <Graph.Node> as first formal parameter.
      -
      -    */
      -    eachLevel: function(node, levelBegin, levelEnd, action, flags) {
      -        var d = node._depth, filter = this.filter(flags), that = this;
      -    levelEnd = levelEnd === false? Number.MAX_VALUE -d : levelEnd;
      -        (function loopLevel(node, levelBegin, levelEnd) {
      -            var d = node._depth;
      -            if(d >= levelBegin && d <= levelEnd && filter(node)) action(node, d);
      -            if(d < levelEnd) {
      -                that.eachAdjacency(node, function(adj) {
      -                    var n = adj.nodeTo;
      -                    if(n._depth > d) loopLevel(n, levelBegin, levelEnd);
      -                });
      -            }
      -        })(node, levelBegin + d, levelEnd + d);      
      -    },
      -
      -    /*
      -       Method: eachSubgraph
      -    
      -       Iterates over a node's children recursively.
      -
      -       Parameters:
      -       node - A <Graph.Node>.
      -       action - A callback function having a <Graph.Node> as first formal parameter.
      -
      -       Example:
      -       (start code js)
      -         Graph.Util.eachSubgraph(node, function(node) {
      -          alert(node.name);
      -         });
      -       (end code)
      -    */
      -    eachSubgraph: function(node, action, flags) {
      -    this.eachLevel(node, 0, false, action, flags);
      -    },
      -
      -    /*
      -       Method: eachSubnode
      -    
      -       Iterates over a node's children (without deeper recursion).
      -       
      -       Parameters:
      -       node - A <Graph.Node>.
      -       action - A callback function having a <Graph.Node> as first formal parameter.
      -
      -       Example:
      -       (start code js)
      -         Graph.Util.eachSubnode(node, function(node) {
      -          alert(node.name);
      -         });
      -       (end code)
      -    */
      -    eachSubnode: function(node, action, flags) {
      -        this.eachLevel(node, 1, 1, action, flags);
      -    },
      -
      -    /*
      -       Method: anySubnode
      -    
      -       Returns *true* if any subnode matches the given condition.
      -
      -       Parameters:
      -       node - A <Graph.Node>.
      -       cond - A callback function returning a Boolean instance. This function has as first formal parameter a <Graph.Node>.
      -
      -       Returns:
      -       A boolean value.
      -
      -       Example:
      -       (start code js)
      -         Graph.Util.anySubnode(node, function(node) { return node.name == "mynodename"; });
      -       (end code)
      -    */
      -    anySubnode: function(node, cond, flags) {
      -        var flag = false;
      -    cond = cond || $lambda(true);
      -    var c = $type(cond) == 'string'? function(n) { return n[cond]; } : cond;
      -    this.eachSubnode(node, function(elem) {
      -      if(c(elem)) flag = true;
      -    }, flags);
      -    return flag;
      -    },
      -  
      -    /*
      -       Method: getSubnodes
      -    
      -       Collects all subnodes for a specified node. The _level_ parameter filters nodes having relative depth of _level_ from the root node.
      -
      -       Parameters:
      -       node - A <Graph.Node>.
      -       level - _optional_ A starting relative depth for collecting nodes. Default's 0.
      -
      -       Returns:
      -       An array of nodes.
      -
      -    */
      -    getSubnodes: function(node, level, flags) {
      -        var ans = [], that = this;
      -        level = level || 0;
      -        var levelStart, levelEnd;
      -        if($type(level) == 'array') {
      -            levelStart = level[0];
      -            levelEnd = level[1];
      -        } else {
      -            levelStart = level;
      -            levelEnd = Number.MAX_VALUE - node._depth;
      -        }
      -        this.eachLevel(node, levelStart, levelEnd, function(n) {
      -      ans.push(n);
      -    }, flags);
      -        return ans;
      -    },
      -  
      -  
      -    /*
      -       Method: getParents
      -    
      -       Returns an Array of <Graph.Nodes> wich are parents of the given node. 
      -
      -       Parameters:
      -       node - A <Graph.Node>.
      -
      -       Returns:
      -       An Array of <Graph.Nodes>.
      -
      -       Example:
      -       (start code js)
      -         var pars = Graph.Util.getParents(node);
      -         if(pars.length > 0) {
      -           //do stuff with parents
      -         }
      -       (end code)
      -    */
      -    getParents: function(node) {
      -        var ans = [];
      -        this.eachAdjacency(node, function(adj) {
      -            var n = adj.nodeTo;
      -            if(n._depth < node._depth) ans.push(n);
      -        });
      -        return ans;
      -    },
      -    
      -    /*
      -    Method: isDescendantOf
      - 
      -    Returns a Boolean instance indicating if some node is descendant of the node with the given id. 
      -
      -    Parameters:
      -    node - A <Graph.Node>.
      -    id - A <Graph.Node> id.
      -
      -    Returns:
      -    Ture if _node_ is descendant of the node with the given _id_. False otherwise.
      -
      -    Example:
      -    (start code js)
      -      var pars = Graph.Util.isDescendantOf(node, "nodeid");
      -    (end code)
      - */
      - isDescendantOf: function(node, id) {
      -    if(node.id == id) return true;
      -    var pars = this.getParents(node), ans = false;
      -    for ( var i = 0; !ans && i < pars.length; i++) {
      -    ans = ans || this.isDescendantOf(pars[i], id);
      -  }
      -    return ans;
      - },
      -
      - /*
      -       Method: clean
      -    
      -       Cleans flags from nodes (by setting the _flag_ property to false).
      -
      -       Parameters:
      -       graph - A <Graph> instance.
      -    */
      -    clean: function(graph) { this.eachNode(graph, function(elem) { elem._flag = false; }); }
      -};
      -
      -
      -
      -/*
      - * File: Graph.Op.js
      - *
      - * Defines an abstract class for performing <Graph> Operations.
      -*/
      -
      -/*
      -   Object: Graph.Op
      -
      -   Generic <Graph> Operations.
      -   
      -   Description:
      -
      -   An abstract class holding unary and binary powerful graph operations such as removingNodes, removingEdges, adding two graphs and morphing.
      -
      -   Implemented by:
      -
      -   <Hypertree.Op>, <RGraph.Op> and <ST.Op>.
      -
      -   Access:
      -
      -   The subclasses for this abstract class can be accessed by using the _op_ property of the <Hypertree>, <RGraph> or <ST> instances created.
      -
      -   See also:
      -
      -   <Hypertree.Op>, <RGraph.Op>, <ST.Op>, <Hypertree>, <RGraph>, <ST>, <Graph>.
      -*/
      -Graph.Op = {
      -
      -    options: {
      -        type: 'nothing',
      -        duration: 2000,
      -    hideLabels: true,
      -        fps:30
      -    },
      -  
      -    /*
      -       Method: removeNode
      -    
      -       Removes one or more <Graph.Nodes> from the visualization. 
      -       It can also perform several animations like fading sequentially, fading concurrently, iterating or replotting.
      -
      -       Parameters:
      -    
      -          node - The node's id. Can also be an array having many ids.
      -          opt - Animation options. It's an object with optional properties
      -          
      -          - _type_ Type of the animation. Can be "nothing", "replot", "fade:seq",  "fade:con" or "iter". Default's "nothing".
      -          - _duration_ Duration of the animation in milliseconds. Default's 2000.
      -          - _fps_ Frames per second for the animation. Default's 30.
      -          - _hideLabels_ Hide labels during the animation. Default's *true*.
      -          - _transition_ Transitions defined in the <Animation> class. Default's the default transition option of the 
      -          <RGraph>, <Hypertree> or <ST> instance created.
      -   
      -      Example:
      -      (start code js)
      -        var rg = new RGraph(canvas, config); //could be new ST or new Hypertree also.
      -        rg.op.removeNode('nodeid', {
      -          type: 'fade:seq',
      -          duration: 1000,
      -          hideLabels: false,
      -          transition: Trans.Quart.easeOut
      -        });
      -        //or also
      -        rg.op.removeNode(['someid', 'otherid'], {
      -          type: 'fade:con',
      -          duration: 1500
      -        });
      -      (end code)
      -    */
      -  
      -    removeNode: function(node, opt) {
      -        var viz = this.viz;
      -        var options = $merge(this.options, viz.controller, opt);
      -        var n = $splat(node);
      -        var i, that, nodeObj;
      -        switch(options.type) {
      -            case 'nothing':
      -                for(i=0; i<n.length; i++) viz.graph.removeNode(n[i]);
      -                break;
      -            
      -            case 'replot':
      -                this.removeNode(n, { type: 'nothing' });
      -                viz.fx.clearLabels();
      -                viz.refresh(true);
      -                break;
      -            
      -            case 'fade:seq': case 'fade':
      -                that = this;
      -                //set alpha to 0 for nodes to remove.
      -                for(i=0; i<n.length; i++) {
      -                    nodeObj = viz.graph.getNode(n[i]);
      -                    nodeObj.endAlpha = 0;
      -                }
      -                viz.fx.animate($merge(options, {
      -                    modes: ['fade:nodes'],
      -                    onComplete: function() {
      -                        that.removeNode(n, { type: 'nothing' });
      -                        viz.fx.clearLabels();
      -                        viz.reposition();
      -                        viz.fx.animate($merge(options, {
      -                            modes: ['linear']
      -                        }));
      -                    }
      -                }));
      -                break;
      -            
      -            case 'fade:con':
      -                that = this;
      -                //set alpha to 0 for nodes to remove. Tag them for being ignored on computing positions.
      -                for(i=0; i<n.length; i++) {
      -                    nodeObj = viz.graph.getNode(n[i]);
      -                    nodeObj.endAlpha = 0;
      -                    nodeObj.ignore = true;
      -                }
      -                viz.reposition();
      -                viz.fx.animate($merge(options, {
      -                    modes: ['fade:nodes', 'linear'],
      -                    onComplete: function() {
      -                        that.removeNode(n, { type: 'nothing' });
      -                    }
      -                }));
      -                break;
      -            
      -            case 'iter':
      -                that = this;
      -                viz.fx.sequence({
      -                    condition: function() { return n.length != 0; },
      -                    step: function() { that.removeNode(n.shift(), { type: 'nothing' });  viz.fx.clearLabels(); },
      -                    onComplete: function() { options.onComplete(); },
      -                    duration: Math.ceil(options.duration / n.length)
      -                });
      -                break;
      -                
      -            default: this.doError();
      -        }
      -    },
      -    
      -    /*
      -       Method: removeEdge
      -    
      -       Removes one or more edges from the visualization. 
      -       It can also perform several animations like fading sequentially, fading concurrently, iterating or replotting.
      -
      -       Parameters:
      -    
      -       vertex - An array having two strings which are the ids of the nodes connected by this edge (i.e ['id1', 'id2']). Can also be a two dimensional array holding many edges (i.e [['id1', 'id2'], ['id3', 'id4'], ...]).
      -          opt - Animation options. It's an object with optional properties
      -          
      -          - _type_ Type of the animation. Can be "nothing", "replot", "fade:seq",  "fade:con" or "iter". Default's "nothing".
      -          - _duration_ Duration of the animation in milliseconds. Default's 2000.
      -          - _fps_ Frames per second for the animation. Default's 30.
      -          - _hideLabels_ Hide labels during the animation. Default's *true*.
      -          - _transition_ Transitions defined in the <Animation> class. Default's the default transition option of the 
      -          <RGraph>, <Hypertree> or <ST> instance created.
      -   
      -      Example:
      -      (start code js)
      -        var rg = new RGraph(canvas, config); //could be new ST or new Hypertree also.
      -        rg.op.removeEdge(['nodeid', 'otherid'], {
      -          type: 'fade:seq',
      -          duration: 1000,
      -          hideLabels: false,
      -          transition: Trans.Quart.easeOut
      -        });
      -        //or also
      -        rg.op.removeEdge([['someid', 'otherid'], ['id3', 'id4']], {
      -          type: 'fade:con',
      -          duration: 1500
      -        });
      -      (end code)
      -    
      -    */
      -    removeEdge: function(vertex, opt) {
      -        var viz = this.viz;
      -        var options = $merge(this.options, viz.controller, opt);
      -        var v = ($type(vertex[0]) == 'string')? [vertex] : vertex;
      -        var i, that, adjs;
      -        switch(options.type) {
      -            case 'nothing':
      -                for(i=0; i<v.length; i++)   viz.graph.removeAdjacence(v[i][0], v[i][1]);
      -                break;
      -            
      -            case 'replot':
      -                this.removeEdge(v, { type: 'nothing' });
      -                viz.refresh(true);
      -                break;
      -            
      -            case 'fade:seq': case 'fade':
      -                that = this;
      -                //set alpha to 0 for edges to remove.
      -                for(i=0; i<v.length; i++) {
      -                    adjs = viz.graph.getAdjacence(v[i][0], v[i][1]);
      -                    if(adjs) {
      -                        adjs[0].endAlpha = 0;
      -                        adjs[1].endAlpha = 0;
      -                    }
      -                }
      -                viz.fx.animate($merge(options, {
      -                    modes: ['fade:vertex'],
      -                    onComplete: function() {
      -                        that.removeEdge(v, { type: 'nothing' });
      -                        viz.reposition();
      -                        viz.fx.animate($merge(options, {
      -                            modes: ['linear']
      -                        }));
      -                    }
      -                }));
      -                break;
      -            
      -            case 'fade:con':
      -                that = this;
      -                //set alpha to 0 for nodes to remove. Tag them for being ignored when computing positions.
      -                for(i=0; i<v.length; i++) {
      -                    adjs = viz.graph.getAdjacence(v[i][0], v[i][1]);
      -                    if(adjs) {
      -                        adjs[0].endAlpha = 0;
      -                        adjs[0].ignore = true;
      -                        adjs[1].endAlpha = 0;
      -                        adjs[1].ignore = true;
      -                    }
      -                }
      -                viz.reposition();
      -                viz.fx.animate($merge(options, {
      -                    modes: ['fade:vertex', 'linear'],
      -                    onComplete: function() {
      -                        that.removeEdge(v, { type: 'nothing' });
      -                    }
      -                }));
      -                break;
      -            
      -            case 'iter':
      -                that = this;
      -                viz.fx.sequence({
      -                    condition: function() { return v.length != 0; },
      -                    step: function() { that.removeEdge(v.shift(), { type: 'nothing' }); viz.fx.clearLabels(); },
      -                    onComplete: function() { options.onComplete(); },
      -                    duration: Math.ceil(options.duration / v.length)
      -                });
      -                break;
      -                
      -            default: this.doError();
      -        }
      -    },
      -    
      -    /*
      -       Method: sum
      -    
      -       Adds a new graph to the visualization. 
      -       
      -       The json graph (or tree) must at least have a common node with the current graph plotted by the visualization. 
      -       
      -       The resulting graph can be defined as follows <http://mathworld.wolfram.com/GraphSum.html>
      -
      -       Parameters:
      -    
      -          json - A json tree or graph structure. See also <Loader.loadJSON>.
      -           opt - Animation options. It's an object with optional properties
      -          
      -          - _type_ Type of the animation. Can be "nothing", "replot", "fade:seq" or "fade:con". Default's "nothing".
      -          - _duration_ Duration of the animation in milliseconds. Default's 2000.
      -          - _fps_ Frames per second for the animation. Default's 30.
      -          - _hideLabels_ Hide labels during the animation. Default's *true*.
      -          - _transition_ Transitions defined in the <Animation> class. Default's the default transition option of the 
      -          <RGraph>, <Hypertree> or <ST> instance created.
      -   
      -      Example:
      -      (start code js)
      -        //json contains a tree or graph structure.
      -
      -        var rg = new RGraph(canvas, config); //could be new ST or new Hypertree also.
      -        rg.op.sum(json, {
      -          type: 'fade:seq',
      -          duration: 1000,
      -          hideLabels: false,
      -          transition: Trans.Quart.easeOut
      -        });
      -        //or also
      -        rg.op.sum(json, {
      -          type: 'fade:con',
      -          duration: 1500
      -        });
      -      (end code)
      -    
      -    */
      -    sum: function(json, opt) {
      -        var viz = this.viz;
      -        var options = $merge(this.options, viz.controller, opt), root = viz.root;
      -        var GUtil, graph;
      -        viz.root = opt.id || viz.root;
      -        switch(options.type) {
      -            case 'nothing':
      -                graph = viz.construct(json);
      -                GUtil = Graph.Util;
      -                GUtil.eachNode(graph, function(elem) {
      -                    GUtil.eachAdjacency(elem, function(adj) {
      -                        viz.graph.addAdjacence(adj.nodeFrom, adj.nodeTo, adj.data);
      -                    });
      -                });
      -                break;
      -            
      -            case 'replot':
      -                viz.refresh(true);
      -                this.sum(json, { type: 'nothing' });
      -                viz.refresh(true);
      -                break;
      -            
      -            case 'fade:seq': case 'fade': case 'fade:con':
      -                GUtil = Graph.Util;
      -                that = this;
      -                graph = viz.construct(json);
      -
      -                //set alpha to 0 for nodes to add.
      -                var fadeEdges = this.preprocessSum(graph);
      -                var modes = !fadeEdges? ['fade:nodes'] : ['fade:nodes', 'fade:vertex'];
      -                viz.reposition();
      -                if(options.type != 'fade:con') {
      -                    viz.fx.animate($merge(options, {
      -                        modes: ['linear'],
      -                        onComplete: function() {
      -                            viz.fx.animate($merge(options, {
      -                                modes: modes,
      -                                onComplete: function() {
      -                                    options.onComplete();
      -                                }
      -                            }));
      -                        }
      -                    }));
      -                } else {
      -                    GUtil.eachNode(viz.graph, function(elem) {
      -                        if (elem.id != root && elem.pos.getp().equals(Polar.KER)) {
      -                          elem.pos.set(elem.endPos); elem.startPos.set(elem.endPos);
      -                        }
      -                    });
      -                    viz.fx.animate($merge(options, {
      -                        modes: ['linear'].concat(modes)
      -                    }));
      -                }
      -                break;
      -
      -            default: this.doError();
      -        }
      -    },
      -    
      -    /*
      -       Method: morph
      -    
      -       This method will _morph_ the current visualized graph into the new _json_ representation passed in the method. 
      -       
      -       Can also perform multiple animations. The _json_ object must at least have the root node in common with the current visualized graph.
      -
      -       Parameters:
      -    
      -           json - A json tree or graph structure. See also <Loader.loadJSON>.
      -           opt - Animation options. It's an object with optional properties
      -          
      -          - _type_ Type of the animation. Can be "nothing", "replot", or "fade". Default's "nothing".
      -          - _duration_ Duration of the animation in milliseconds. Default's 2000.
      -          - _fps_ Frames per second for the animation. Default's 30.
      -          - _hideLabels_ Hide labels during the animation. Default's *true*.
      -          - _transition_ Transitions defined in the <Animation> class. Default's the default transition option of the 
      -          <RGraph>, <Hypertree> or <ST> instance created.
      -   
      -      Example:
      -      (start code js)
      -        //json contains a tree or graph structure.
      -
      -        var rg = new RGraph(canvas, config); //could be new ST or new Hypertree also.
      -        rg.op.morph(json, {
      -          type: 'fade',
      -          duration: 1000,
      -          hideLabels: false,
      -          transition: Trans.Quart.easeOut
      -        });
      -        //or also
      -        rg.op.morph(json, {
      -          type: 'fade',
      -          duration: 1500
      -        });
      -      (end code)
      -    
      -    */
      -    morph: function(json, opt) {
      -        var viz = this.viz;
      -        var options = $merge(this.options, viz.controller, opt), root = viz.root;
      -        var GUtil, graph;
      -        viz.root = opt.id || viz.root;
      -        switch(options.type) {
      -            case 'nothing':
      -                graph = viz.construct(json);
      -                GUtil = Graph.Util;
      -                GUtil.eachNode(graph, function(elem) {
      -                    GUtil.eachAdjacency(elem, function(adj) {
      -                        viz.graph.addAdjacence(adj.nodeFrom, adj.nodeTo, adj.data);
      -                    });
      -                });
      -                GUtil.eachNode(viz.graph, function(elem) {
      -                    GUtil.eachAdjacency(elem, function(adj) {
      -                        if(!graph.getAdjacence(adj.nodeFrom.id, adj.nodeTo.id)) {
      -                            viz.graph.removeAdjacence(adj.nodeFrom.id, adj.nodeTo.id);
      -                        }
      -                    });
      -                    if(!graph.hasNode(elem.id)) viz.graph.removeNode(elem.id);
      -                });
      -                
      -                break;
      -            
      -            case 'replot':
      -                viz.fx.clearLabels(true);
      -                this.morph(json, { type: 'nothing' });
      -                viz.refresh(true);
      -                viz.refresh(true);
      -                break;
      -                
      -            case 'fade:seq': case 'fade': case 'fade:con':
      -                GUtil = Graph.Util;
      -                that = this;
      -                graph = viz.construct(json);
      -                //preprocessing for adding nodes.
      -                var fadeEdges = this.preprocessSum(graph);
      -                //preprocessing for nodes to delete.
      -                GUtil.eachNode(viz.graph, function(elem) {
      -                    if(!graph.hasNode(elem.id)) {
      -                        elem.alpha = 1; elem.startAlpha = 1; elem.endAlpha = 0; elem.ignore = true;
      -                    }
      -                }); 
      -                GUtil.eachNode(viz.graph, function(elem) {
      -                    if(elem.ignore) return;
      -                    GUtil.eachAdjacency(elem, function(adj) {
      -                        if(adj.nodeFrom.ignore || adj.nodeTo.ignore) return;
      -                        var nodeFrom = graph.getNode(adj.nodeFrom.id);
      -                        var nodeTo = graph.getNode(adj.nodeTo.id);
      -                        if(!nodeFrom.adjacentTo(nodeTo)) {
      -                            var adjs = viz.graph.getAdjacence(nodeFrom.id, nodeTo.id);
      -                            fadeEdges = true;
      -                            adjs[0].alpha = 1; adjs[0].startAlpha = 1; adjs[0].endAlpha = 0; adjs[0].ignore = true;
      -                            adjs[1].alpha = 1; adjs[1].startAlpha = 1; adjs[1].endAlpha = 0; adjs[1].ignore = true;
      -                        }
      -                    });
      -                }); 
      -                var modes = !fadeEdges? ['fade:nodes'] : ['fade:nodes', 'fade:vertex'];
      -                viz.reposition();
      -                GUtil.eachNode(viz.graph, function(elem) {
      -                    if (elem.id != root && elem.pos.getp().equals(Polar.KER)) {
      -                      elem.pos.set(elem.endPos); elem.startPos.set(elem.endPos);
      -                    }
      -                });
      -                viz.fx.animate($merge(options, {
      -                    modes: ['polar'].concat(modes),
      -                    onComplete: function() {
      -                        GUtil.eachNode(viz.graph, function(elem) {
      -                            if(elem.ignore) viz.graph.removeNode(elem.id);
      -                        });
      -                        GUtil.eachNode(viz.graph, function(elem) {
      -                            GUtil.eachAdjacency(elem, function(adj) {
      -                                if(adj.ignore) viz.graph.removeAdjacence(adj.nodeFrom.id, adj.nodeTo.id);
      -                            });
      -                        });
      -                        options.onComplete();
      -                    }
      -                }));
      -                break;
      -
      -            default: this.doError();
      -        }
      -    },
      -    
      -    preprocessSum: function(graph) {
      -        var viz = this.viz;
      -    var GUtil = Graph.Util;
      -        GUtil.eachNode(graph, function(elem) {
      -            if(!viz.graph.hasNode(elem.id)) {
      -                viz.graph.addNode(elem);
      -                var n = viz.graph.getNode(elem.id);
      -                n.alpha = 0; n.startAlpha = 0; n.endAlpha = 1;
      -            }
      -        }); 
      -        var fadeEdges = false;
      -        GUtil.eachNode(graph, function(elem) {
      -            GUtil.eachAdjacency(elem, function(adj) {
      -                var nodeFrom = viz.graph.getNode(adj.nodeFrom.id);
      -                var nodeTo = viz.graph.getNode(adj.nodeTo.id);
      -                if(!nodeFrom.adjacentTo(nodeTo)) {
      -                    var adjs = viz.graph.addAdjacence(nodeFrom, nodeTo, adj.data);
      -                    if(nodeFrom.startAlpha == nodeFrom.endAlpha 
      -                    && nodeTo.startAlpha == nodeTo.endAlpha) {
      -                        fadeEdges = true;
      -                        adjs[0].alpha = 0; adjs[0].startAlpha = 0; adjs[0].endAlpha = 1;
      -                        adjs[1].alpha = 0; adjs[1].startAlpha = 0; adjs[1].endAlpha = 1;
      -                    } 
      -                }
      -            });
      -        }); 
      -        return fadeEdges;
      -    }
      -};
      -
      -
      -
      -/*
      - * File: Graph.Plot.js
      - *
      - * Defines an abstract class for performing <Graph> rendering and animation.
      - *
      - */
      -
      -
      -/*
      -   Object: Graph.Plot
      -
      -   Generic <Graph> rendering and animation methods.
      -   
      -   Description:
      -
      -   An abstract class for plotting a generic graph structure.
      -
      -   Implemented by:
      -
      -   <Hypertree.Plot>, <RGraph.Plot>, <ST.Plot>.
      -
      -   Access:
      -
      -   The subclasses for this abstract class can be accessed by using the _fx_ property of the <Hypertree>, <RGraph>, or <ST> instances created.
      -
      -   See also:
      -
      -   <Hypertree.Plot>, <RGraph.Plot>, <ST.Plot>, <Hypertree>, <RGraph>, <ST>, <Graph>.
      -
      -*/
      -Graph.Plot = {
      -    
      -    Interpolator: {
      -        'moebius': function(elem, delta, vector) {
      -            if(delta <= 1 || vector.norm() <= 1) {
      -        var x = vector.x, y = vector.y;
      -              var ans = elem.startPos.getc().moebiusTransformation(vector);
      -              elem.pos.setc(ans.x, ans.y);
      -              vector.x = x; vector.y = y;
      -            }           
      -    },
      -
      -        'linear': function(elem, delta) {
      -            var from = elem.startPos.getc(true);
      -            var to = elem.endPos.getc(true);
      -            elem.pos.setc((to.x - from.x) * delta + from.x, (to.y - from.y) * delta + from.y);
      -        },
      -
      -        'fade:nodes': function(elem, delta) {
      -            if(delta <= 1 && (elem.endAlpha != elem.alpha)) {
      -                var from = elem.startAlpha;
      -                var to   = elem.endAlpha;
      -                elem.alpha = from + (to - from) * delta;
      -            }
      -        },
      -        
      -        'fade:vertex': function(elem, delta) {
      -            var adjs = elem.adjacencies;
      -            for(var id in adjs) this['fade:nodes'](adjs[id], delta);
      -        },
      -        
      -        'polar': function(elem, delta) {
      -            var from = elem.startPos.getp(true);
      -            var to = elem.endPos.getp();
      -      var ans = to.interpolate(from, delta);
      -            elem.pos.setp(ans.theta, ans.rho);
      -        }
      -    },
      -    
      -    //A flag value indicating if node labels are being displayed or not.
      -    labelsHidden: false,
      -    //Label DOM element
      -    labelContainer: false,
      -    //Label DOM elements hash.
      -    labels: {},
      -
      -    /*
      -       Method: getLabelContainer
      -    
      -       Lazy fetcher for the label container.
      -
      -       Returns:
      -
      -       The label container DOM element.
      -
      -       Example:
      -
      -      (start code js)
      -        var rg = new RGraph(canvas, config); //can be also Hypertree or ST
      -        var labelContainer = rg.fx.getLabelContainer();
      -        alert(labelContainer.innerHTML);
      -      (end code)
      -    */
      -    getLabelContainer: function() {
      -        return this.labelContainer? this.labelContainer : this.labelContainer = document.getElementById(this.viz.config.labelContainer);
      -    },
      -    
      -    /*
      -       Method: getLabel
      -    
      -       Lazy fetcher for the label DOM element.
      -
      -       Parameters:
      -
      -       id - The label id (which is also a <Graph.Node> id).
      -
      -       Returns:
      -
      -       The label DOM element.
      -
      -       Example:
      -
      -      (start code js)
      -        var rg = new RGraph(canvas, config); //can be also Hypertree or ST
      -        var label = rg.fx.getLabel('someid');
      -        alert(label.innerHTML);
      -      (end code)
      -      
      -    */
      -    getLabel: function(id) {
      -        return (id in this.labels && this.labels[id] != null)? this.labels[id] : this.labels[id] = document.getElementById(id);
      -    },
      -    
      -    /*
      -       Method: hideLabels
      -    
      -       Hides all labels (by hiding the label container).
      -
      -       Parameters:
      -
      -       hide - A boolean value indicating if the label container must be hidden or not.
      -
      -       Example:
      -       (start code js)
      -        var rg = new RGraph(canvas, config); //can be also Hypertree or ST
      -        rg.fx.hideLabels(true);
      -       (end code)
      -       
      -    */
      -    hideLabels: function (hide) {
      -        var container = this.getLabelContainer();
      -        if(hide) container.style.display = 'none';
      -        else container.style.display = '';
      -        this.labelsHidden = hide;
      -    },
      -    
      -    /*
      -       Method: clearLabels
      -    
      -       Clears the label container.
      -
      -       Useful when using a new visualization with the same canvas element/widget.
      -
      -       Parameters:
      -
      -       force - Forces deletion of all labels.
      -
      -       Example:
      -       (start code js)
      -        var rg = new RGraph(canvas, config); //can be also Hypertree or ST
      -        rg.fx.clearLabels();
      -        (end code)
      -    */
      -    clearLabels: function(force) {
      -        for(var id in this.labels) {
      -            if (force || !this.viz.graph.hasNode(id)) {
      -                this.disposeLabel(id);
      -                delete this.labels[id];
      -            }
      -        }
      -    },
      -    
      -    /*
      -       Method: disposeLabel
      -    
      -       Removes a label.
      -
      -       Parameters:
      -
      -       id - A label id (which generally is also a <Graph.Node> id).
      -
      -       Example:
      -       (start code js)
      -        var rg = new RGraph(canvas, config); //can be also Hypertree or ST
      -        rg.fx.disposeLabel('labelid');
      -       (end code)
      -    */
      -    disposeLabel: function(id) {
      -        var elem = this.getLabel(id);
      -        if(elem && elem.parentNode) {
      -      elem.parentNode.removeChild(elem);
      -    }  
      -    },
      -
      -    /*
      -       Method: hideLabel
      -    
      -       Hides the corresponding <Graph.Node> label.
      -        
      -       Parameters:
      -
      -       node - A <Graph.Node>. Can also be an array of <Graph.Nodes>.
      -       flag - If *true*, nodes will be shown. Otherwise nodes will be hidden.
      -
      -       Example:
      -       (start code js)
      -        var rg = new RGraph(canvas, config); //can be also Hypertree or ST
      -        rg.fx.hideLabel(rg.graph.getNode('someid'), false);
      -       (end code)
      -    */
      -    hideLabel: function(node, flag) {
      -    node = $splat(node);
      -    var st = flag? "" : "none", lab, that = this;
      -    $each(node, function(n) {
      -      var lab = that.getLabel(n.id);
      -      if (lab) {
      -           lab.style.display = st;
      -      } 
      -    });
      -    },
      -
      -    /*
      -       Method: sequence
      -    
      -       Iteratively performs an action while refreshing the state of the visualization.
      -
      -       Parameters:
      -
      -       options - Some sequence options like
      -      
      -       - _condition_ A function returning a boolean instance in order to stop iterations.
      -       - _step_ A function to execute on each step of the iteration.
      -       - _onComplete_ A function to execute when the sequence finishes.
      -       - _duration_ Duration (in milliseconds) of each step.
      -
      -      Example:
      -       (start code js)
      -        var rg = new RGraph(canvas, config); //can be also Hypertree or ST
      -        var i = 0;
      -        rg.fx.sequence({
      -          condition: function() {
      -           return i == 10;
      -          },
      -          step: function() {
      -            alert(i++);
      -          },
      -          onComplete: function() {
      -           alert('done!');
      -          }
      -        });
      -       (end code)
      -
      -    */
      -    sequence: function(options) {
      -        var that = this;
      -    options = $merge({
      -            condition: $lambda(false),
      -            step: $empty,
      -            onComplete: $empty,
      -            duration: 200
      -        }, options || {});
      -
      -        var interval = setInterval(function() {
      -            if(options.condition()) {
      -                options.step();
      -            } else {
      -                clearInterval(interval);
      -                options.onComplete();
      -            }
      -            that.viz.refresh(true);
      -        }, options.duration);
      -    },
      -    
      -    /*
      -       Method: animate
      -    
      -       Animates a <Graph> by interpolating some <Graph.Nodes> properties.
      -
      -       Parameters:
      -
      -       opt - Animation options. This object contains as properties
      -
      -       - _modes_ (required) An Array of animation types. Possible values are "linear", "polar", "moebius", "fade:nodes" and "fade:vertex".
      -
      -       "linear", "polar" and "moebius" animation options will interpolate <Graph.Nodes> "startPos" and "endPos" properties, storing the result in "pos".
      -       
      -       "fade:nodes" and "fade:vertex" animation options will interpolate <Graph.Nodes> and/or <Graph.Adjacence> "startAlpha" and "endAlpha" properties, storing the result in "alpha".
      -
      -       - _duration_ Duration (in milliseconds) of the Animation.
      -       - _fps_ Frames per second.
      -       - _hideLabels_ hide labels or not during the animation.
      -
      -       ...and other <Hypertree>, <RGraph> or <ST> controller methods.
      -
      -       Example:
      -       (start code js)
      -        var rg = new RGraph(canvas, config); //can be also Hypertree or ST
      -        rg.fx.animate({
      -          modes: ['linear'],
      -          hideLabels: false
      -        }); 
      -       (end code)
      -       
      -       
      -    */
      -    animate: function(opt, versor) {
      -        var that = this,
      -    viz = this.viz,
      -    graph  = viz.graph,
      -    GUtil = Graph.Util;
      -    opt = $merge(viz.controller, opt || {}); 
      -    
      -        if(opt.hideLabels) this.hideLabels(true);
      -        this.animation.setOptions($merge(opt, {
      -            $animating: false,
      -            compute: function(delta) {
      -        var vector = versor? versor.scale(-delta) : null;
      -        GUtil.eachNode(graph, function(node) { 
      -                    for(var i=0; i<opt.modes.length; i++) {
      -            that.Interpolator[opt.modes[i]](node, delta, vector);
      -          } 
      -                });
      -                that.plot(opt, this.$animating);
      -                this.$animating = true;
      -            },
      -            complete: function() {
      -                GUtil.eachNode(graph, function(node) { 
      -                    node.startPos.set(node.pos);
      -                    node.startAlpha = node.alpha;
      -                });
      -                if(opt.hideLabels) that.hideLabels(false);
      -                that.plot(opt);
      -                opt.onComplete();
      -                opt.onAfterCompute();
      -            }       
      -    })).start();
      -    },
      -    
      -    /*
      -       Method: plot
      -    
      -       Plots a <Graph>.
      -
      -       Parameters:
      -
      -       opt - _optional_ Plotting options.
      -
      -       Example:
      -
      -       (start code js)
      -       var rg = new RGraph(canvas, config); //can be also Hypertree or ST
      -       rg.fx.plot(); 
      -       (end code)
      -
      -    */
      -    plot: function(opt, animating) {
      -        var viz = this.viz, 
      -    aGraph = viz.graph, 
      -    canvas = viz.canvas, 
      -    id = viz.root, 
      -    that = this, 
      -    ctx = canvas.getCtx(), 
      -    GUtil = Graph.Util;
      -        opt = opt || this.viz.controller;
      -    opt.clearCanvas && canvas.clear();
      -        
      -        var T = !!aGraph.getNode(id).visited;
      -        GUtil.eachNode(aGraph, function(node) {
      -            GUtil.eachAdjacency(node, function(adj) {
      -        var nodeTo = adj.nodeTo;
      -                if(!!nodeTo.visited === T && node.drawn && nodeTo.drawn) {
      -                    !animating && opt.onBeforePlotLine(adj);
      -                    ctx.save();
      -                    ctx.globalAlpha = Math.min(Math.min(node.alpha, nodeTo.alpha), adj.alpha);
      -                    that.plotLine(adj, canvas, animating);
      -                    ctx.restore();
      -                    !animating && opt.onAfterPlotLine(adj);
      -                }
      -            });
      -            ctx.save();
      -      if(node.drawn) {
      -              ctx.globalAlpha = node.alpha;
      -              !animating && opt.onBeforePlotNode(node);
      -              that.plotNode(node, canvas, animating);
      -              !animating && opt.onAfterPlotNode(node);
      -      }
      -            if(!that.labelsHidden && opt.withLabels) {
      -        if(node.drawn && ctx.globalAlpha >= 0.95) {
      -          that.plotLabel(canvas, node, opt);
      -        } else {
      -          that.hideLabel(node, false);
      -        }
      -      }
      -            ctx.restore();
      -            node.visited = !T;
      -        });
      -    },
      -
      -    /*
      -       Method: plotLabel
      -    
      -       Plots a label for a given node.
      -
      -       Parameters:
      -
      -       canvas - A <Canvas> instance.
      -       node - A <Graph.Node>.
      -       controller - A configuration object. See also <Hypertree>, <RGraph>, <ST>.
      -
      -    */
      -    plotLabel: function(canvas, node, controller) {
      -    var id = node.id, tag = this.getLabel(id);
      -        if(!tag && !(tag = document.getElementById(id))) {
      -            tag = document.createElement('div');
      -            var container = this.getLabelContainer();
      -            container.appendChild(tag);
      -            tag.id = id;
      -            tag.className = 'node';
      -            tag.style.position = 'absolute';
      -            controller.onCreateLabel(tag, node);
      -            this.labels[node.id] = tag;
      -        }
      -    this.placeLabel(tag, node, controller);
      -    },
      -  
      -  /*
      -       Method: plotNode
      -    
      -       Plots a <Graph.Node>.
      -
      -       Parameters:
      -       
      -       node - A <Graph.Node>.
      -       canvas - A <Canvas> element.
      -
      -    */
      -    plotNode: function(node, canvas, animating) {
      -        var nconfig = this.node, data = node.data;
      -        var cond = nconfig.overridable && data;
      -        var width = cond && data.$lineWidth || nconfig.lineWidth;
      -        var color = cond && data.$color || nconfig.color;
      -        var ctx = canvas.getCtx();
      -        
      -        ctx.lineWidth = width;
      -    ctx.fillStyle = color;
      -    ctx.strokeStyle = color; 
      -
      -        var f = node.data && node.data.$type || nconfig.type;
      -        this.nodeTypes[f].call(this, node, canvas, animating);
      -    },
      -    
      -    /*
      -       Method: plotLine
      -    
      -       Plots a line.
      -
      -       Parameters:
      -
      -       adj - A <Graph.Adjacence>.
      -       canvas - A <Canvas> instance.
      -
      -    */
      -    plotLine: function(adj, canvas, animating) {
      -        var econfig = this.edge, data = adj.data;
      -        var cond = econfig.overridable && data;
      -        var width = cond && data.$lineWidth || econfig.lineWidth;
      -        var color = cond && data.$color || econfig.color;
      -        var ctx = canvas.getCtx();
      -        
      -        ctx.lineWidth = width;
      -        ctx.fillStyle = color;
      -        ctx.strokeStyle = color; 
      -
      -        var f = adj.data && adj.data.$type || econfig.type;
      -        this.edgeTypes[f].call(this, adj, canvas, animating);
      -    },    
      -  
      -  /*
      -       Method: fitsInCanvas
      -    
      -       Returns _true_ or _false_ if the label for the node is contained in the canvas dom element or not.
      -
      -       Parameters:
      -
      -       pos - A <Complex> instance (I'm doing duck typing here so any object with _x_ and _y_ parameters will do).
      -       canvas - A <Canvas> instance.
      -       
      -       Returns:
      -
      -       A boolean value specifying if the label is contained in the <Canvas> DOM element or not.
      -
      -    */
      -    fitsInCanvas: function(pos, canvas) {
      -        var size = canvas.getSize();
      -        if(pos.x >= size.width || pos.x < 0 
      -            || pos.y >= size.height || pos.y < 0) return false;
      -        return true;                    
      -    }
      -};
      -
      -
      -/*
      - * File: Loader.js
      - * 
      - * Provides methods for loading JSON data.
      - *
      - * Description:
      - *
      - * Provides the <Loader.loadJSON> method implemented by the main visualization classes to load JSON Trees and Graphs.
      - * 
      - * Implemented By: 
      - * 
      - * <ST>, <TM>, <Hypertree> and <RGraph> classes
      - * 
      - */
      -
      -/*
      -   Object: Loader
      -
      -   Provides static methods for loading JSON data.
      -
      -   Description:
      -   
      -   This object is extended by the main Visualization classes (<ST>, <Hypertree>, <TM> and <RGraph>)
      -   in order to implement the <Loader.loadJSON> method. 
      -   
      -   The <Loader.loadJSON> method accepts JSON Trees and Graph objects. This will be explained in detail in the <Loader.loadJSON> method definition.
      -*/
      -var Loader = {
      -     construct: function(json) {
      -        var isGraph = ($type(json) == 'array');
      -        var ans = new Graph(this.graphOptions);
      -        if(!isGraph) 
      -            //make tree
      -            (function (ans, json) {
      -                ans.addNode(json);
      -                for(var i=0, ch = json.children; i<ch.length; i++) {
      -                    ans.addAdjacence(json, ch[i]);
      -                    arguments.callee(ans, ch[i]);
      -                }
      -            })(ans, json);
      -        else
      -            //make graph
      -            (function (ans, json) {
      -                var getNode = function(id) {
      -                    for(var w=0; w<json.length; w++) { 
      -                      if(json[w].id == id) {
      -                        return json[w];
      -                      }
      -                    }
      -                    return undefined;
      -                };
      -
      -                for(var i=0; i<json.length; i++) {
      -                    ans.addNode(json[i]);
      -                    for(var j=0, adj = json[i].adjacencies; j<adj.length; j++) {
      -                        var node = adj[j], data;
      -                        if(typeof adj[j] != 'string') {
      -                            data = node.data;
      -                            node = node.nodeTo;
      -                        }
      -                        ans.addAdjacence(json[i], getNode(node), data);
      -                    }
      -                }
      -            })(ans, json);
      -
      -        return ans;
      -    },
      -
      -    /*
      -     Method: loadJSON
      -    
      -     Loads a JSON structure to the visualization. The JSON structure can be a JSON tree or graph structure.
      -     
      -        A JSON tree or graph structure consists of nodes, each having as properties
      -       - _id_ A unique identifier for the node
      -       - _name_ A node's name
      -       - _data_ The data property contains a hash (i.e {}) where you can store all 
      -       the information you want about this node.
      -        
      -        Hash keys prefixed with a dollar sign (i.e $) have special meaning. I will detail those properties below.
      -      
      -        For JSON tree structures, there's an extra property _children_ of type Array which contains the node's children.
      -      
      -      Example:
      -
      -      (start code js)
      -        var json = {  
      -            "id": "aUniqueIdentifier",  
      -            "name": "usually a nodes name",  
      -            "data": {
      -                "some key": "some value",
      -                "some other key": "some other value"
      -             },  
      -            "children": [ 'other nodes or empty' ]  
      -        };  
      -      (end code)
      -        
      -        JSON Graph structures consist of an array of nodes, each specifying the nodes to which the current node is connected.
      -        
      -        For JSON Graph structures, the _children_ property is replaced by the _adjacencies_ property.
      -        
      -        There are two types of Graph structures, _simple_ and _extended_ graph structures.
      -        
      -        For _simple_ Graph structures, the adjacencies property contains an array of strings, each specifying the 
      -        id of the node connected to the main node.
      -        
      -        Example:
      -        
      -        (start code js)
      -        var json = [  
      -            {  
      -                "id": "aUniqueIdentifier",  
      -                "name": "usually a nodes name",  
      -                "data": {
      -                    "some key": "some value",
      -                    "some other key": "some other value"
      -                 },  
      -                "adjacencies": ["anotherUniqueIdentifier", "yetAnotherUniqueIdentifier", 'etc']  
      -            },
      -
      -            'other nodes go here...' 
      -        ];          
      -        (end code)
      -        
      -        For _extended_ Graph structures, the adjacencies property contains an array of Adjacency objects that have as properties
      -        - nodeTo The other node connected by this adjacency.
      -        - data A data property, where we can store custom key/value information.
      -        
      -        Example:
      -        
      -        (start code js)
      -        var json = [  
      -            {  
      -                "id": "aUniqueIdentifier",  
      -                "name": "usually a nodes name",  
      -                "data": {
      -                    "some key": "some value",
      -                    "some other key": "some other value"
      -                 },  
      -                "adjacencies": [  
      -                {  
      -                    nodeTo:"aNodeId",  
      -                    data: {} //put whatever you want here  
      -                },
      -                'other adjacencies go here...'  
      -            },
      -
      -            'other nodes go here...' 
      -        ];          
      -        (end code)
      -        
      -        Since all visualizations implement this method, this will be the entry point for JSON data for all visualizations. This method could be called like this
      -        
      -        Example:
      -        
      -        (start code js)
      -        var ht = new Hypertree(canvas, config);
      -        ht.loadJSON(json);
      -        
      -        var tm = new TM.Squarified(config);
      -        tm.loadJSON(json);
      -        
      -        var st = new ST(canvas, config);
      -        st.loadJSON(json);
      -        
      -        var rg = new RGraph(canvas, config);
      -        rg.loadJSON(json);
      -        
      -        (end code)
      -        
      -       Parameters:
      -    
      -          json - A JSON Tree or Graph structure.
      -          i - For Graph structures only. Sets the indexed node as root for the visualization.
      -
      -    */
      -    loadJSON: function(json, i) {
      -    this.json = json;
      -    this.graph = this.construct(json);
      -    if($type(json) != 'array'){
      -      this.root = json.id;
      -    } else {
      -      this.root = json[i? i : 0].id;
      -    }
      -  }
      -};
      -
      -
      -
      -/*
      - * File: Animation.js
      - * 
      - * Core <Animation> and <Trans> transition classes.
      - *
      -*/
      -
      -/*
      -   Object: Trans
      -    
      -     An object containing multiple type of transformations. 
      -     
      -     Based on:
      -         
      -     Easing and Transition animation methods are based in the MooTools Framework <http://mootools.net>. Copyright (c) 2006-2009 Valerio Proietti, <http://mad4milk.net/>. MIT license <http://mootools.net/license.txt>.
      -
      -     Used by:
      -
      -     <RGraph>, <Hypertree> and <ST> classes.
      -
      -     Description:
      -
      -     This object is used for specifying different animation transitions in the <RGraph>, <Hypertree> and <ST> classes.
      -
      -     There are many different type of animation transitions.
      -
      -     linear:
      -
      -     Displays a linear transition
      -
      -     >Trans.linear
      -     
      -     (see Linear.png)
      -
      -     Quad:
      -
      -     Displays a Quadratic transition.
      -  
      -     >Trans.Quad.easeIn
      -     >Trans.Quad.easeOut
      -     >Trans.Quad.easeInOut
      -     
      -    (see Quad.png)
      -
      -    Cubic:
      -
      -    Displays a Cubic transition.
      -
      -    >Trans.Cubic.easeIn
      -    >Trans.Cubic.easeOut
      -    >Trans.Cubic.easeInOut
      -
      -    (see Cubic.png)
      -
      -    Quart:
      -
      -    Displays a Quartetic transition.
      -
      -    >Trans.Quart.easeIn
      -    >Trans.Quart.easeOut
      -    >Trans.Quart.easeInOut
      -
      -    (see Quart.png)
      -
      -    Quint:
      -
      -    Displays a Quintic transition.
      -
      -    >Trans.Quint.easeIn
      -    >Trans.Quint.easeOut
      -    >Trans.Quint.easeInOut
      -
      -    (see Quint.png)
      -
      -    Expo:
      -
      -    Displays an Exponential transition.
      -
      -    >Trans.Expo.easeIn
      -    >Trans.Expo.easeOut
      -    >Trans.Expo.easeInOut
      -
      -    (see Expo.png)
      -
      -    Circ:
      -
      -    Displays a Circular transition.
      -
      -    >Trans.Circ.easeIn
      -    >Trans.Circ.easeOut
      -    >Trans.Circ.easeInOut
      -
      -    (see Circ.png)
      -
      -    Sine:
      -
      -    Displays a Sineousidal transition.
      -
      -    >Trans.Sine.easeIn
      -    >Trans.Sine.easeOut
      -    >Trans.Sine.easeInOut
      -
      -    (see Sine.png)
      -
      -    Back:
      -
      -    >Trans.Back.easeIn
      -    >Trans.Back.easeOut
      -    >Trans.Back.easeInOut
      -
      -    (see Back.png)
      -
      -    Bounce:
      -
      -    Bouncy transition.
      -
      -    >Trans.Bounce.easeIn
      -    >Trans.Bounce.easeOut
      -    >Trans.Bounce.easeInOut
      -
      -    (see Bounce.png)
      -
      -    Elastic:
      -
      -    Elastic curve.
      -
      -    >Trans.Elastic.easeIn
      -    >Trans.Elastic.easeOut
      -    >Trans.Elastic.easeInOut
      -
      -    (see Elastic.png)
      -
      -
      -
      -*/
      -this.Trans = {
      -    linear: function(p) { return p; }
      -};
      -
      -(function() {
      -
      -  var makeTrans = function(transition, params){
      -      params = $splat(params);
      -      return $extend(transition, {
      -          easeIn: function(pos){
      -              return transition(pos, params);
      -          },
      -          easeOut: function(pos){
      -              return 1 - transition(1 - pos, params);
      -          },
      -          easeInOut: function(pos){
      -              return (pos <= 0.5) ? transition(2 * pos, params) / 2 : (2 - transition(2 * (1 - pos), params)) / 2;
      -          }
      -      });
      -  };
      -  
      -  var transitions = {
      -
      -      Pow: function(p, x){
      -          return Math.pow(p, x[0] || 6);
      -      },
      -  
      -      Expo: function(p){
      -          return Math.pow(2, 8 * (p - 1));
      -      },
      -  
      -      Circ: function(p){
      -          return 1 - Math.sin(Math.acos(p));
      -      },
      -  
      -      Sine: function(p){
      -          return 1 - Math.sin((1 - p) * Math.PI / 2);
      -      },
      -  
      -      Back: function(p, x){
      -          x = x[0] || 1.618;
      -          return Math.pow(p, 2) * ((x + 1) * p - x);
      -      },
      -  
      -      Bounce: function(p){
      -          var value;
      -          for (var a = 0, b = 1; 1; a += b, b /= 2){
      -              if (p >= (7 - 4 * a) / 11){
      -                  value = b * b - Math.pow((11 - 6 * a - 11 * p) / 4, 2);
      -                  break;
      -              }
      -          }
      -          return value;
      -      },
      -  
      -      Elastic: function(p, x){
      -          return Math.pow(2, 10 * --p) * Math.cos(20 * p * Math.PI * (x[0] || 1) / 3);
      -      }
      -  
      -  };
      -  
      -  $each(transitions, function(val, key) {
      -    Trans[key] = makeTrans(val);
      -  });
      -
      -  $each(['Quad', 'Cubic', 'Quart', 'Quint'], function(elem, i) {
      -    Trans[elem] = makeTrans(function(p){
      -            return Math.pow(p, [i + 2]);
      -        });
      -  });
      -  
      -})();
      -
      -/*
      -   Class: Animation
      -    
      -   A Class that can perform animations for generic objects.
      -
      -   If you are looking for animation transitions please take a look at the <Trans> object.
      -
      -   Used by:
      -
      -   <Graph.Plot>
      -   
      -   Based on:
      -   
      -   The Animation class is based in the MooTools Framework <http://mootools.net>. Copyright (c) 2006-2009 Valerio Proietti, <http://mad4milk.net/>. MIT license <http://mootools.net/license.txt>.
      -
      -*/
      -
      -var Animation = new Class({
      -
      -    initalize: function(options) {
      -     this.setOptions(options);
      -  },
      -  
      -  setOptions: function(options) {
      -        var opt = {
      -            duration: 2500,
      -            fps: 40,
      -            transition: Trans.Quart.easeInOut,
      -            compute: $empty,
      -            complete: $empty
      -        };
      -        this.opt = $merge(opt, options || {});
      -    return this;
      -  },
      -  
      -  getTime: function() {
      -        return $time();
      -    },
      -    
      -    step: function(){
      -        var time = this.getTime(), opt = this.opt;
      -        if (time < this.time + opt.duration){
      -            var delta = opt.transition((time - this.time) / opt.duration);
      -            opt.compute(delta);
      -        } else {
      -            this.timer = clearInterval(this.timer);
      -            opt.compute(1);
      -            opt.complete();
      -        }
      -    },
      -
      -    start: function(){
      -        this.time = 0;
      -        this.startTimer();
      -        return this;
      -    },
      -
      -    startTimer: function(){
      -    var that = this, opt = this.opt;
      -        if (this.timer) return false;
      -        this.time = this.getTime() - this.time;
      -        this.timer = setInterval((function () { that.step(); }), Math.round(1000 / opt.fps));
      -        return true;
      -    }
      -});
      -
      -
      -
      -/*
      - * File: Spacetree.js
      - * 
      - * Implements the <ST> class and other derived classes.
      - *
      - * Description:
      - *
      - * The main idea of the spacetree algorithm is to take the most common tree layout, and to expand nodes that are "context-related" .i.e lying on the path between the root node and a selected node. Useful animations to contract and expand nodes are also included.
      - *
      - * Inspired by:
      - *
      - * SpaceTree: Supporting Exploration in Large Node Link Tree, Design Evolution and Empirical Evaluation (Catherine Plaisant, Jesse Grosjean, Benjamin B. Bederson)
      - *
      - * <http://hcil.cs.umd.edu/trs/2002-05/2002-05.pdf>
      - *
      - * Disclaimer:
      - *
      - * This visualization was built from scratch, taking only the paper as inspiration, and only shares some features with the Spacetree.
      - *
      - */
      -
      -/*
      -     Class: ST
      -     
      -     The main ST class
      -
      -     Extends:
      -
      -     <Loader>
      -
      -     Parameters:
      -
      -     canvas - A <Canvas> Class
      -     config - A configuration/controller object.
      -
      -     Configuration:
      -    
      -     The configuration object can have the following properties (all properties are optional and have a default value)
      -      
      -     *General*
      -
      -     - _levelsToShow_ Depth of the plotted tree. The plotted tree will be pruned in order to fit the specified depth if constrained=true. Default's 2.
      -     - _constrained_ If true, the algorithm will try to plot only the part of the tree that fits the Canvas.
      -     - _subtreeOffset_ Separation offset between subtrees. Default's 8.
      -     - _siblingOffset_ Separation offset between siblings. Default's 5.
      -     - _levelDistance_ Distance between levels. Default's 30.
      -     - _orientation_ Sets the orientation layout. Implemented orientations are _left_ (the root node will be placed on the left side of the screen), _top_ (the root node will be placed on top of the screen), _bottom_ and _right_. Default's "left".
      -     - _align_ Whether the tree alignment is left, center or right.
      -     - _indent_ Used when alignment is left or right and shows an indentation between parent and children. Default's 10.
      -     - _withLabels_ Whether the visualization should use/create labels or not. Default's *true*.
      -
      -     *Node*
      -     
      -     Customize the visualization nodes' shape, color, and other style properties.
      -
      -     - _Node_
      -
      -     This object has as properties
      -
      -     - _overridable_ Determine whether or not nodes properties can be overriden by a particular node. Default's false.
      -
      -     If given a JSON tree or graph, a node _data_ property contains properties which are the same as defined here but prefixed with 
      -     a dollar sign (i.e $), the node properties will override the global node properties.
      -
      -     - _type_ Node type (shape). Possible options are "none", "square", "rectangle", "ellipse" and "circle". Default's "rectangle".
      -     - _color_ Node color. Default's '#ccb'.
      -     - _lineWidth_ Line width. If nodes aren't drawn with strokes then this property won't be of any use. Default's 1.
      -     - _height_ Node height. Used for plotting rectangular nodes. _Width_ and _height_ properties are also used as bounding box for nodes of different shapes. 
      -     This means that for all shapes you'd have to make sure that the node's shape is contained in the bounding box defined by _width_ and _height_ parameters. Default's 20.
      -     - _width_ Node width. Used for plotting rectangular nodes and for calculating a node's bounding box. Default's 90.
      -     - _dim_ An extra parameter used by other complex shapes such as square and circle to determine the shape's diameter. 
      -     Please notice that even if these complex shapes (square, circle) only use _dim_ for calculating it's diameter property, the complex shape must be 
      -     contained in the bounding box calculated with the _width_ and _height_ parameters. Default's 15.
      -     - _align_ Defines a node's alignment. Possible values are "center", "left", "right". Default's "center".
      -
      -     *Edge*
      -
      -     Customize the visualization edges' shape, color, and other style properties.
      -
      -     - _Edge_
      -
      -     This object has as properties
      -
      -     - _overridable_ Determine whether or not edges properties can be overriden by a particular edge object. Default's false.
      -
      -     If given a JSON _complex_ graph (defined in <Loader.loadJSON>), an adjacency _data_ property contains properties which are the same as defined here but prefixed with 
      -     a dollar sign (i.e $), the adjacency properties will override the global edge properties.
      -
      -     - _type_ Edge type (shape). Possible options are "none", "line", "quadratic:begin", "quadratic:end", "bezier" and "arrow". Default's "line".
      -     - _color_ Edge color. Default's '#ccb'.
      -     - _lineWidth_ Line width. If edges aren't drawn with strokes then this property won't be of any use. Default's 1.
      -     - _dim_ An extra parameter used by other complex shapes such as quadratic, arrow and bezier to determine the shape's diameter. 
      -
      -     *Animations*
      -
      -     - _duration_ Duration of the animation in milliseconds. Default's 700.
      -     - _fps_ Frames per second. Default's 25.
      -     - _transition_ One of the transitions defined in the <Animation> class. Default's Quart.easeInOut.
      -     - _clearCanvas_ Whether to clear canvas on each animation frame or not. Default's true.
      -     
      -    *Controller options*
      -
      -    You can also implement controller functions inside the configuration object. This functions are
      -    
      -    - _onBeforeCompute(node)_ This method is called right before performing all computation and animations to the JIT visualization.
      -    - _onAfterCompute()_ This method is triggered right after all animations or computations for the JIT visualizations ended.
      -    - _onCreateLabel(domElement, node)_ This method receives the label dom element as first parameter, and the corresponding <Graph.Node> as second parameter. This method will only be called on label creation. Note that a <Graph.Node> is a node from the input tree/graph you provided to the visualization. If you want to know more about what kind of JSON tree/graph format is used to feed the visualizations, you can take a look at <Loader.loadJSON>. This method proves useful when adding events to the labels used by the JIT.
      -    - _onPlaceLabel(domElement, node)_ This method receives the label dom element as first parameter and the corresponding <Graph.Node> as second parameter. This method is called each time a label has been placed on the visualization, and thus it allows you to update the labels properties, such as size or position. Note that onPlaceLabel will be triggered after updating the labels positions. That means that, for example, the left and top css properties are already updated to match the nodes positions.
      -    - _onBeforePlotNode(node)_ This method is triggered right before plotting a given node. The _node_ parameter is the <Graph.Node> to be plotted. 
      -This method is useful for changing a node style right before plotting it.
      -    - _onAfterPlotNode(node)_ This method is triggered right after plotting a given node. The _node_ parameter is the <Graph.Node> plotted.
      -    - _onBeforePlotLine(adj)_ This method is triggered right before plotting an edge. The _adj_ parameter is a <Graph.Adjacence> object. 
      -This method is useful for adding some styles to a particular edge before being plotted.
      -    - _onAfterPlotLine(adj)_ This method is triggered right after plotting an edge. The _adj_ parameter is the <Graph.Adjacence> plotted.
      -    - _request(nodeId, level, onComplete)_ This method is used for buffering information into the visualization. When clicking on an empty node,
      - the visualization will make a request for this node's subtree, specifying a given level for this subtree. Once this request is completed the _onComplete_ 
      -object must be called with the given result.
      -
      -    Example:
      -
      -    Here goes a complete example. In most cases you won't be forced to implement all properties and methods. In fact, 
      -    all configuration properties  have the default value assigned.
      -
      -    I won't be instanciating a <Canvas> class here. If you want to know more about instanciating a <Canvas> class 
      -    please take a look at the <Canvas> class documentation.
      -
      -    (start code js)
      -      var st = new ST(canvas, {
      -        orientation: "left",
      -        levelsToShow: 2,
      -        subtreeOffset: 8,
      -        siblingOffset: 5,
      -        levelDistance: 30,
      -        withLabels: true,
      -        align: "center",
      -        multitree: false,
      -        indent: 10,
      -        Node: {
      -          overridable: false,
      -          type: 'rectangle',
      -          color: '#ccb',
      -          lineWidth: 1,
      -          height: 20,
      -          width: 90,
      -          dim: 15,
      -          align: "center"
      -        },
      -        Edge: {
      -          overridable: false,
      -          type: 'line',
      -          color: '#ccc',
      -          dim: 15,
      -          lineWidth: 1
      -        },
      -        duration: 700,
      -        fps: 25,
      -        transition: Trans.Quart.easeInOut,
      -        clearCanvas: true,
      -        
      -        onBeforeCompute: function(node) {
      -          //do something onBeforeCompute
      -        },
      -        onAfterCompute:  function () {
      -          //do something onAfterCompute
      -        },
      -        onCreateLabel:   function(domElement, node) {
      -          //do something onCreateLabel
      -        },
      -        onPlaceLabel:    function(domElement, node) {
      -          //do something onPlaceLabel
      -        },
      -        onBeforePlotNode:function(node) {
      -          //do something onBeforePlotNode
      -        },
      -        onAfterPlotNode: function(node) {
      -          //do something onAfterPlotNode
      -        },
      -        onBeforePlotLine:function(adj) {
      -          //do something onBeforePlotLine
      -        },
      -        onAfterPlotLine: function(adj) {
      -          //do something onAfterPlotLine
      -        },
      -        request:         false
      -
      -      });
      -    (end code)
      -
      -    Instance Properties:
      -
      -    - _graph_ Access a <Graph> instance.
      -    - _op_ Access a <ST.Op> instance.
      -    - _fx_ Access a  <ST.Plot> instance.
      - */
      -
      -(function () {
      -
      -//Layout functions
      -var slice = Array.prototype.slice;
      -
      -/*
      -   Calculates the max width and height nodes for a tree level
      -*/  
      -function getBoundaries(graph, config, level, orn) {
      -    var dim = config.Node, GUtil = Graph.Util;
      -    var multitree = config.multitree;
      -    if(dim.overridable) {
      -        var w = -1, h = -1;
      -        GUtil.eachNode(graph, function(n) {
      -            if(n._depth == level && (!multitree || 
      -             		('$orn' in n.data) && 
      -             		n.data.$orn == orn)) {
      -                var dw = n.data.$width || dim.width;
      -                var dh = n.data.$height || dim.height;
      -                w = (w < dw)? dw : w;
      -                h = (h < dh)? dh : h;
      -            }
      -        });
      -        return {
      -            'width':  w < 0? dim.width : w,
      -            'height': h < 0? dim.height : h
      -        };
      -    } else {
      -        return dim;
      -    }
      -};
      -
      - function movetree(node, prop, val, orn) {
      -   var p = (orn == "left" || orn == "right")? "y" : "x";
      -   node[prop][p] += val;
      - };
      - 
      - function moveextent(extent, val) {
      -     var ans = [];
      -     $each(extent, function(elem) {
      -         elem = slice.call(elem);
      -         elem[0] += val;
      -         elem[1] += val;
      -         ans.push(elem);
      -     });
      -     return ans;
      - };
      - 
      - function merge(ps, qs) {
      -   if(ps.length == 0) return qs;
      -   if(qs.length == 0) return ps;
      -   var p = ps.shift(), q = qs.shift();
      -   return [[p[0], q[1]]].concat(merge(ps, qs));  
      - };
      - 
      - function mergelist(ls, def) {
      -     def = def || [];
      -     if(ls.length == 0) return def; 
      -     var ps = ls.pop();
      -     return mergelist(ls, merge(ps, def));
      - };
      - 
      - function fit(ext1, ext2, subtreeOffset, siblingOffset, i) {
      -     if(ext1.length <= i || 
      -        ext2.length <= i) return 0;
      -     
      -     var p = ext1[i][1], q = ext2[i][0];
      -     return  Math.max(fit(ext1, ext2, subtreeOffset, siblingOffset, ++i) 
      -    		 + subtreeOffset, p - q + siblingOffset);
      - };
      - 
      - function fitlistl(es, subtreeOffset, siblingOffset) {
      -   function $fitlistl(acc, es, i) {
      -       if(es.length <= i) return [];
      -       var e = es[i], ans = fit(acc, e, subtreeOffset, siblingOffset, 0);
      -       return [ans].concat($fitlistl(merge(acc, moveextent(e, ans)), es, ++i));
      -   };
      -   return $fitlistl([], es, 0);
      - };
      - 
      - function fitlistr(es, subtreeOffset, siblingOffset) {
      -   function $fitlistr(acc, es, i) {
      -       if(es.length <= i) return [];
      -       var e = es[i], ans = -fit(e, acc, subtreeOffset, siblingOffset, 0);
      -       return [ans].concat($fitlistr(merge(moveextent(e, ans), acc), es, ++i));
      -   };
      -   es = slice.call(es);
      -   var ans = $fitlistr([], es.reverse(), 0);
      -   return ans.reverse();
      - };
      - 
      - function fitlist(es, subtreeOffset, siblingOffset, align) {
      -    var esl = fitlistl(es, subtreeOffset, siblingOffset),
      -        esr = fitlistr(es, subtreeOffset, siblingOffset);
      -    
      -    if(align == "left")
      -    	esr = esl;
      -    else if(align == "right")
      -    	esl = esr;
      -    
      -    for(var i = 0, ans = []; i < esl.length; i++) {
      -        ans[i] = (esl[i] + esr[i]) / 2;
      -    }
      -    return ans;
      - };
      - 
      - function design(graph, node, prop, config, orn) {
      -     var multitree = config.multitree;
      -     var auxp = ['x', 'y'], auxs = ['width', 'height'];
      -     var ind = +(orn == "left" || orn == "right");
      -     var p = auxp[ind], notp = auxp[1 - ind];
      -     
      -     var cnode = config.Node;
      -     var s = auxs[ind], nots = auxs[1 - ind];
      -
      -     var siblingOffset = config.siblingOffset;
      -     var subtreeOffset = config.subtreeOffset;
      -     var align = config.align;
      -     
      -     var GUtil = Graph.Util;
      -
      -     function $design(node, maxsize, acum) {
      -         var sval = (cnode.overridable && node.data["$" + s]) || cnode[s];
      -         var notsval = maxsize || ((cnode.overridable && node.data["$" + nots]) || cnode[nots]);
      -         
      -         var trees = [], extents = [], chmaxsize = false;
      -         var chacum = notsval + config.levelDistance;
      -         GUtil.eachSubnode(node, function(n) {
      -             if(n.exist && (!multitree ||  
      -             		('$orn' in n.data) && 
      -             		n.data.$orn == orn)) {
      -            	 
      -                 if(!chmaxsize) 
      -                    chmaxsize = getBoundaries(graph, config, n._depth, orn);
      -                 
      -                 var s = $design(n, chmaxsize[nots], acum + chacum);
      -                 trees.push(s.tree);
      -                 extents.push(s.extent);
      -             }
      -         });
      -         var positions = fitlist(extents, subtreeOffset, siblingOffset, align);
      -         for(var i=0, ptrees = [], pextents = []; i < trees.length; i++) {
      -             movetree(trees[i], prop, positions[i], orn);
      -             pextents.push(moveextent(extents[i], positions[i]));
      -         }
      -         var resultextent = [[-sval/2, sval/2]].concat(mergelist(pextents));
      -         node[prop][p] = 0;
      -
      -         if (orn == "top" || orn == "left") {
      -            node[prop][notp] = acum;
      -         } else {
      -            node[prop][notp] = -acum;
      -         }
      -
      -         return {
      -           tree: node,
      -           extent: resultextent  
      -         };
      -     };
      -     $design(node, false, 0);
      - };
      -
      -
      -
      -this.ST= (function() {
      -    //Define some private methods first...
      -    //Nodes in path
      -    var nodesInPath = [];
      -    //Nodes to contract
      -    function getNodesToHide(node) {
      -      node = node || this.clickedNode;
      -      var Geom = this.geom, GUtil = Graph.Util;
      -      var graph = this.graph;
      -      var canvas = this.canvas;
      -      var level = node._depth, nodeArray = [];
      -	  GUtil.eachNode(graph, function(n) {
      -        if(n.exist && !n.selected) {
      -            if(GUtil.isDescendantOf(n, node.id)) {
      -              if(n._depth <= level) nodeArray.push(n);
      -            } else {
      -              nodeArray.push(n);
      -            }
      -        }
      -	  });
      -	  var leafLevel = Geom.getRightLevelToShow(node, canvas);
      -	  GUtil.eachLevel(node, leafLevel, leafLevel, function(n) {
      -        if(n.exist && !n.selected) nodeArray.push(n);
      -	  });
      -	    
      -	  for (var i = 0; i < nodesInPath.length; i++) {
      -	    var n = this.graph.getNode(nodesInPath[i]);
      -	    if(!GUtil.isDescendantOf(n, node.id)) {
      -	      nodeArray.push(n);
      -	    }
      -	  } 
      -	  return nodeArray;       
      -    };
      -    //Nodes to expand
      -     function getNodesToShow(node) {
      -        var nodeArray= [], GUtil = Graph.Util, config = this.config;
      -        node = node || this.clickedNode;
      -        GUtil.eachLevel(this.clickedNode, 0, config.levelsToShow, function(n) {
      -            if(config.multitree && !('$orn' in n.data) 
      -            		&& GUtil.anySubnode(n, function(ch){ return ch.exist && !ch.drawn; })) {
      -            	nodeArray.push(n);
      -            } else if(n.drawn && !GUtil.anySubnode(n, "drawn")) {
      -        		nodeArray.push(n);
      -            }
      -        });
      -        return nodeArray;
      -     };
      -    //Now define the actual class.    
      -    return new Class({
      -    
      -        Implements: Loader,
      -        
      -        initialize: function(canvas, controller) {
      -            var innerController = {
      -                onBeforeCompute: $empty,
      -                onAfterCompute:  $empty,
      -                onCreateLabel:   $empty,
      -                onPlaceLabel:    $empty,
      -                onComplete:      $empty,
      -                onBeforePlotNode:$empty,
      -                onAfterPlotNode: $empty,
      -                onBeforePlotLine:$empty,
      -                onAfterPlotLine: $empty,
      -                request:         false
      -            };
      -            
      -            var config= {
      -                orientation: "left",
      -                labelContainer: canvas.id + '-label',
      -                levelsToShow: 2,
      -                subtreeOffset: 8,
      -                siblingOffset: 5,
      -                levelDistance: 30,
      -                withLabels: true,
      -                clearCanvas: true,
      -                align: "center",
      -                indent:10,
      -                multitree: false,
      -                constrained: true,
      -                
      -                Node: {
      -                    overridable: false,
      -                    type: 'rectangle',
      -                    color: '#ccb',
      -                    lineWidth: 1,
      -                    height: 20,
      -                    width: 90,
      -                    dim: 15,
      -                    align: "center"
      -                },
      -                Edge: {
      -                    overridable: false,
      -                    type: 'line',
      -                    color: '#ccc',
      -                    dim: 15,
      -                    lineWidth: 1
      -                },
      -                duration: 700,
      -                fps: 25,
      -                transition: Trans.Quart.easeInOut
      -            };
      -            
      -            this.controller = this.config = $merge(config, innerController, controller);
      -            this.canvas = canvas;
      -            this.graphOptions = {
      -                'complex': true
      -            };
      -            this.graph = new Graph(this.graphOptions);
      -            this.fx = new ST.Plot(this);
      -            this.op = new ST.Op(this);
      -            this.group = new ST.Group(this);
      -            this.geom = new ST.Geom(this);
      -            this.clickedNode=  null;
      -            
      -        },
      -    
      -        /*
      -         Method: plot
      -        
      -         Plots the tree. Usually this method is called right after computing nodes' positions.
      -
      -        */  
      -        plot: function() { this.fx.plot(this.controller); },
      -    
      -      
      -        /*
      -         Method: switchPosition
      -        
      -         Switches the tree orientation.
      -
      -         Parameters:
      -
      -        pos - The new tree orientation. Possible values are "top", "left", "right" and "bottom".
      -        method - Set this to "animate" if you want to animate the tree when switching its position. You can also set this parameter to "replot" to just replot the subtree.
      -        onComplete - _optional_ This callback is called once the "switching" animation is complete.
      -
      -         Example:
      -
      -         (start code js)
      -           st.switchPosition("right", "animate", {
      -            onComplete: function() {
      -              alert('completed!');
      -            } 
      -           });
      -         (end code)
      -        */  
      -        switchPosition: function(pos, method, onComplete) {
      -          var Geom = this.geom, Plot = this.fx, that = this;
      -          if(!Plot.busy) {
      -              Plot.busy = true;
      -              this.contract({
      -                  onComplete: function() {
      -                      Geom.switchOrientation(pos);
      -                      that.compute('endPos', false);
      -                      Plot.busy = false;
      -                      if(method == 'animate') {
      -                    	  that.onClick(that.clickedNode.id, onComplete);  
      -                      } else if(method == 'replot') {
      -                    	  that.select(that.clickedNode.id, onComplete);
      -                      }
      -                  }
      -              }, pos);
      -          }
      -        },
      -
      -        /*
      -        Method: switchAlignment
      -       
      -        Switches the tree alignment.
      -
      -        Parameters:
      -
      -       align - The new tree alignment. Possible values are "left", "center" and "right".
      -       method - Set this to "animate" if you want to animate the tree after aligning its position. You can also set this parameter to "replot" to just replot the subtree.
      -       onComplete - _optional_ This callback is called once the "switching" animation is complete.
      -
      -        Example:
      -
      -        (start code js)
      -          st.switchAlignment("right", "animate", {
      -           onComplete: function() {
      -             alert('completed!');
      -           } 
      -          });
      -        (end code)
      -       */  
      -       switchAlignment: function(align, method, onComplete) {
      -        this.config.align = align;
      -        if(method == 'animate') {
      -        	this.select(this.clickedNode.id, onComplete);
      -        } else if(method == 'replot') {
      -        	this.onClick(this.clickedNode.id, onComplete);	
      -        }
      -       },
      -
      -       /*
      -        Method: addNodeInPath
      -       
      -        Adds a node to the current path as selected node. This node will be visible (as in non-collapsed) at all times.
      -        
      -
      -        Parameters:
      -
      -       id - A <Graph.Node> id.
      -
      -        Example:
      -
      -        (start code js)
      -          st.addNodeInPath("somenodeid");
      -        (end code)
      -       */  
      -       addNodeInPath: function(id) {
      -           nodesInPath.push(id);
      -           this.select((this.clickedNode && this.clickedNode.id) || this.root);
      -       },       
      -
      -       /*
      -       Method: clearNodesInPath
      -      
      -       Removes all nodes tagged as selected by the <ST.addNodeInPath> method.
      -       
      -     See also:
      -     
      -     <ST.addNodeInPath>
      -     
      -       Example:
      -
      -       (start code js)
      -         st.clearNodesInPath();
      -       (end code)
      -      */  
      -       clearNodesInPath: function(id) {
      -           nodesInPath.length = 0;
      -           this.select((this.clickedNode && this.clickedNode.id) || this.root);
      -       },
      -        
      -       /*
      -         Method: refresh
      -        
      -         Computes nodes' positions and replots the tree.
      -         
      -       */
      -       refresh: function() {
      -           this.reposition();
      -           this.select((this.clickedNode && this.clickedNode.id) || this.root);
      -       },    
      -
      -       reposition: function() {
      -            Graph.Util.computeLevels(this.graph, this.root, 0, "ignore");
      -             this.geom.setRightLevelToShow(this.clickedNode, this.canvas);
      -            Graph.Util.eachNode(this.graph, function(n) {
      -                if(n.exist) n.drawn = true;
      -            });
      -            this.compute('endPos');
      -        },
      -    
      -        /*
      -         Method: compute
      -        
      -         Computes nodes' positions.
      -
      -        */  
      -        compute: function (property, computeLevels) {
      -            var prop = property || 'startPos';
      -            var node = this.graph.getNode(this.root);
      -            $extend(node, {
      -                'drawn':true,
      -                'exist':true,
      -                'selected':true
      -            });
      -            if(!!computeLevels || !("_depth" in node))
      -                Graph.Util.computeLevels(this.graph, this.root, 0, "ignore");
      -            this.computePositions(node, prop);
      -        },
      -        
      -        computePositions: function(node, prop) {
      -        	var config = this.config;
      -        	var multitree = config.multitree;
      -        	var align = config.align;
      -        	var indent = align !== 'center' && config.indent;
      -        	var orn = config.orientation;
      -        	var orns = multitree? ['top', 'right', 'bottom', 'left'] : [orn];
      -        	
      -        	var that = this;
      -        	$each(orns, function(orn) {
      -        		//calculate layout
      -        		design(that.graph, node, prop, that.config, orn);
      -        		var i = ['x', 'y'][+(orn == "left" || orn == "right")];
      -        		//absolutize
      -                (function red(node) {
      -                    Graph.Util.eachSubnode(node, function(n) {
      -                        if(n.exist && (!multitree || 
      -                        		('$orn' in n.data) && 
      -                        		n.data.$orn == orn)) {
      -
      -                        	n[prop][i] += node[prop][i];
      -                        	if(indent) {
      -                        		n[prop][i] += align == 'left'? indent : -indent; 
      -                        	}
      -                            red(n);
      -                        }
      -                    });
      -                })(node);
      -        	}); 
      -        },
      -        
      -          requestNodes: function(node, onComplete) {
      -            var handler = $merge(this.controller, onComplete), 
      -            lev = this.config.levelsToShow, GUtil = Graph.Util;
      -            if(handler.request) {
      -                var leaves = [], d = node._depth;
      -                GUtil.eachLevel(node, 0, lev, function(n) {
      -                    if(n.drawn && 
      -                     !GUtil.anySubnode(n)) {
      -                     leaves.push(n);
      -                     n._level = lev - (n._depth - d);
      -                    }
      -                });
      -                this.group.requestNodes(leaves, handler);
      -            }
      -              else
      -                handler.onComplete();
      -          },
      -     
      -          contract: function(onComplete, switched) {
      -            var orn  = this.config.orientation;
      -            var Geom = this.geom, Group = this.group;
      -            if(switched) Geom.switchOrientation(switched);
      -            var nodes = getNodesToHide.call(this);
      -            if(switched) Geom.switchOrientation(orn);
      -            Group.contract(nodes, $merge(this.controller, onComplete));
      -          },
      -      
      -         move: function(node, onComplete) {
      -            this.compute('endPos', false);
      -            var move = onComplete.Move, offset = {
      -                'x': move.offsetX,
      -                'y': move.offsetY 
      -            };
      -            if(move.enable) {
      -                this.geom.translate(node.endPos.add(offset).$scale(-1), "endPos");
      -            }
      -            this.fx.animate($merge(this.controller, { modes: ['linear'] }, onComplete));
      -         },
      -      
      -      
      -        expand: function (node, onComplete) {
      -            var nodeArray = getNodesToShow.call(this, node);
      -            this.group.expand(nodeArray, $merge(this.controller, onComplete));
      -        },
      -    
      -    
      -        selectPath: function(node) {
      -          var GUtil = Graph.Util, that = this;
      -          GUtil.eachNode(this.graph, function(n) { n.selected = false; }); 
      -          function path(node) {
      -              if(node == null || node.selected) return;
      -              node.selected = true;
      -              $each(that.group.getSiblings([node])[node.id], 
      -              function(n) { 
      -                   n.exist = true; 
      -                   n.drawn = true; 
      -              });    
      -              var parents = GUtil.getParents(node);
      -              parents = (parents.length > 0)? parents[0] : null;
      -              path(parents);
      -          };
      -          for(var i=0, ns = [node.id].concat(nodesInPath); i < ns.length; i++) {
      -              path(this.graph.getNode(ns[i]));
      -          }
      -        },
      -      
      -        /*
      -        Method: setRoot
      -     
      -         Switches the current root node.
      -     
      -        Parameters:
      -           id - The id of the node to be set as root.
      -           method - Set this to "animate" if you want to animate the tree after adding the subtree. You can also set this parameter to "replot" to just replot the subtree.
      -           onComplete - _optional_ An action to perform after the animation (if any).
      - 
      -        Example:
      -
      -        (start code js)
      -          st.setRoot('my_node_id', 'animate', {
      -             onComplete: function() {
      -               alert('complete!');
      -             }
      -          });
      -        (end code)
      -     */
      -     setRoot: function(id, method, onComplete) {
      -        	var that = this, canvas = this.canvas;
      -        	var rootNode = this.graph.getNode(this.root);
      -        	var clickedNode = this.graph.getNode(id);
      -        	function $setRoot() {
      -            	if(this.config.multitree && clickedNode.data.$orn) {
      -            		var orn = clickedNode.data.$orn;
      -            		var opp = {
      -            				'left': 'right',
      -            				'right': 'left',
      -            				'top': 'bottom',
      -            				'bottom': 'top'
      -            		}[orn];
      -            		rootNode.data.$orn = opp;
      -            		(function tag(rootNode) {
      -                		Graph.Util.eachSubnode(rootNode, function(n) {
      -                			if(n.id != id) {
      -                				n.data.$orn = opp;
      -                				tag(n);
      -                			}
      -                		});
      -            		})(rootNode);
      -            		delete clickedNode.data.$orn;
      -            	}
      -            	this.root = id;
      -            	this.clickedNode = clickedNode;
      -            	Graph.Util.computeLevels(this.graph, this.root, 0, "ignore");
      -        	}
      -
      -        	//delete previous orientations (if any)
      -        	delete rootNode.data.$orns;
      -
      -        	if(method == 'animate') {
      -        		this.onClick(id, {
      -        			onBeforeMove: function() {
      -        				$setRoot.call(that);
      -        				that.selectPath(clickedNode);
      -        			}
      -        		});
      -        	} else if(method == 'replot') {
      -        		$setRoot.call(this);
      -        		this.select(this.root);
      -        	}
      -     },
      -
      -     /*
      -           Method: addSubtree
      -        
      -            Adds a subtree, performing optionally an animation.
      -        
      -           Parameters:
      -              subtree - A JSON Tree object. See also <Loader.loadJSON>.
      -              method - Set this to "animate" if you want to animate the tree after adding the subtree. You can also set this parameter to "replot" to just replot the subtree.
      -              onComplete - _optional_ An action to perform after the animation (if any).
      -    
      -           Example:
      -
      -           (start code js)
      -             st.addSubtree(json, 'animate', {
      -                onComplete: function() {
      -                  alert('complete!');
      -                }
      -             });
      -           (end code)
      -        */
      -        addSubtree: function(subtree, method, onComplete) {
      -            if(method == 'replot') {
      -                this.op.sum(subtree, $extend({ type: 'replot' }, onComplete || {}));
      -            } else if (method == 'animate') {
      -                this.op.sum(subtree, $extend({ type: 'fade:seq' }, onComplete || {}));
      -            }
      -        },
      -    
      -        /*
      -           Method: removeSubtree
      -        
      -            Removes a subtree, performing optionally an animation.
      -        
      -           Parameters:
      -              id - The _id_ of the subtree to be removed.
      -              removeRoot - Remove the root of the subtree or only its subnodes.
      -              method - Set this to "animate" if you want to animate the tree after removing the subtree. You can also set this parameter to "replot" to just replot the subtree.
      -              onComplete - _optional_ An action to perform after the animation (if any).
      -
      -          Example:
      -
      -          (start code js)
      -            st.removeSubtree('idOfSubtreeToBeRemoved', false, 'animate', {
      -              onComplete: function() {
      -                alert('complete!');
      -              }
      -            });
      -          (end code)
      -    
      -        */
      -        removeSubtree: function(id, removeRoot, method, onComplete) {
      -            var node = this.graph.getNode(id), subids = [];
      -            Graph.Util.eachLevel(node, +!removeRoot, false, function(n) {
      -                subids.push(n.id);
      -            });
      -            if(method == 'replot') {
      -                this.op.removeNode(subids, $extend({ type: 'replot' }, onComplete || {}));
      -            } else if (method == 'animate') {
      -                this.op.removeNode(subids, $extend({ type: 'fade:seq'}, onComplete || {}));
      -            }
      -        },
      -    
      -        /*
      -           Method: select
      -        
      -            Selects a sepecific node in the Spacetree without performing an animation. Useful when selecting 
      -            nodes which are currently hidden or deep inside the tree.
      -
      -          Parameters:
      -            id - The id of the node to select.
      -            onComplete - _optional_ onComplete callback.
      -
      -          Example:
      -          (start code js)
      -            st.select('mynodeid', {
      -              onComplete: function() {
      -                alert('complete!');
      -              }
      -            });
      -          (end code)
      -        */
      -        select: function(id, onComplete) {
      -            var group = this.group, geom = this.geom;
      -            var node=  this.graph.getNode(id), canvas = this.canvas;
      -            var root  = this.graph.getNode(this.root);
      -            var complete = $merge(this.controller, onComplete);
      -            var that = this;
      -    
      -            complete.onBeforeCompute(node);
      -            this.selectPath(node);
      -            this.clickedNode= node;
      -            this.requestNodes(node, {
      -                onComplete: function(){
      -                    group.hide(group.prepare(getNodesToHide.call(that)), complete);
      -                    geom.setRightLevelToShow(node, canvas);
      -                    that.compute("pos");
      -                    Graph.Util.eachNode(that.graph, function(n) { 
      -                        var pos = n.pos.getc(true);
      -                        n.startPos.setc(pos.x, pos.y);
      -                        n.endPos.setc(pos.x, pos.y);
      -                        n.visited = false; 
      -                    });
      -                    that.geom.translate(node.endPos.scale(-1), ["pos", "startPos", "endPos"]);
      -                    group.show(getNodesToShow.call(that));              
      -                    that.plot();
      -                    complete.onAfterCompute(that.clickedNode);
      -                    complete.onComplete();
      -                }
      -            });     
      -        },
      -    
      -      /*
      -         Method: onClick
      -    
      -        This method is called when clicking on a tree node. It mainly performs all calculations and the animation of contracting, translating and expanding pertinent nodes.
      -        
      -            
      -         Parameters:
      -        
      -            id - A node id.
      -            options - A group of options and callbacks such as
      -
      -            - _onComplete_ an object callback called when the animation finishes.
      -            - _Move_ an object that has as properties _offsetX_ or _offsetY_ for adding some offset position to the centered node.
      -
      -        Example:
      -
      -        (start code js)
      -          st.onClick('mynodeid', {
      -	          Move: {
      -	          	enable: true,
      -	            offsetX: 30,
      -	            offsetY: 5
      -	          },
      -	          onComplete: function() {
      -	              alert('yay!');
      -	          }
      -          });
      -        (end code)
      -    
      -        */    
      -      onClick: function (id, options) {
      -        var canvas = this.canvas, that = this, Fx = this.fx, Util = Graph.Util, Geom = this.geom;
      -        var innerController = {
      -            Move: {
      -        	  enable: true,
      -              offsetX: 0,
      -              offsetY: 0  
      -            },
      -            onBeforeRequest: $empty,
      -            onBeforeContract: $empty,
      -            onBeforeMove: $empty,
      -            onBeforeExpand: $empty
      -        };
      -        var complete = $merge(this.controller, innerController, options);
      -        
      -        if(!this.busy) {
      -            this.busy= true;
      -            var node=  this.graph.getNode(id);
      -            this.selectPath(node, this.clickedNode);
      -            this.clickedNode= node;
      -            complete.onBeforeCompute(node);
      -            complete.onBeforeRequest(node);
      -            this.requestNodes(node, {
      -                onComplete: function() {
      -                    complete.onBeforeContract(node);
      -                    that.contract({
      -                        onComplete: function() {
      -                            Geom.setRightLevelToShow(node, canvas);
      -                            complete.onBeforeMove(node);
      -                            that.move(node, {
      -                                Move: complete.Move,
      -                                onComplete: function() {
      -                                    complete.onBeforeExpand(node);
      -                                    that.expand(node, {
      -                                        onComplete: function() {
      -                                            that.busy = false;
      -                                            complete.onAfterCompute(id);
      -                                            complete.onComplete();
      -                                        }
      -                                    }); //expand
      -                                }
      -                            }); //move
      -                        }
      -                    });//contract
      -                }
      -            });//request
      -        }
      -      }
      -    });
      -
      -})();
      -
      -/*
      -   Class: ST.Op
      -    
      -   Performs advanced operations on trees and graphs.
      -
      -   Extends:
      -
      -   All <Graph.Op> methods
      -
      -   Access:
      -
      -   This instance can be accessed with the _op_ parameter of the st instance created.
      -
      -   Example:
      -
      -   (start code js)
      -    var st = new ST(canvas, config);
      -    st.op.morph //or can also call any other <Graph.Op> method
      -   (end code)
      -
      -*/
      -ST.Op = new Class({
      -    Implements: Graph.Op,
      -    
      -    initialize: function(viz) {
      -        this.viz = viz;
      -    }
      -});
      -
      -/*
      -    
      -     Performs operations on group of nodes.
      -
      -*/
      -ST.Group = new Class({
      -    
      -    initialize: function(viz) {
      -        this.viz = viz;
      -        this.canvas = viz.canvas;
      -        this.config = viz.config;
      -        this.animation = new Animation;
      -        this.nodes = null;
      -    },
      -    
      -    /*
      -    
      -       Calls the request method on the controller to request a subtree for each node. 
      -    */
      -    requestNodes: function(nodes, controller) {
      -        var counter = 0, len = nodes.length, nodeSelected = {};
      -        var complete = function() { controller.onComplete(); };
      -        var viz = this.viz;
      -        if(len == 0) complete();
      -        for(var i=0; i<len; i++) {
      -            nodeSelected[nodes[i].id] = nodes[i];
      -            controller.request(nodes[i].id, nodes[i]._level, {
      -                onComplete: function(nodeId, data) {
      -                    if(data && data.children) {
      -                        data.id = nodeId;
      -                        viz.op.sum(data, { type: 'nothing' });
      -                    }
      -                    if(++counter == len) {
      -                        Graph.Util.computeLevels(viz.graph, viz.root, 0);
      -                        complete();
      -                    }
      -                }
      -            });
      -        }
      -    },
      -    
      -    /*
      -    
      -       Collapses group of nodes. 
      -    */
      -    contract: function(nodes, controller) {
      -        var GUtil = Graph.Util;
      -        var viz = this.viz;
      -        var that = this;
      -
      -        nodes = this.prepare(nodes);
      -        this.animation.setOptions($merge(controller, {
      -            $animating: false,
      -            compute: function(delta) {
      -              if(delta == 1) delta = 0.99;
      -              that.plotStep(1 - delta, controller, this.$animating);
      -              this.$animating = 'contract';
      -            },
      -            
      -            complete: function() {
      -                that.hide(nodes, controller);
      -            }       
      -        })).start();
      -    },
      -    
      -    hide: function(nodes, controller) {
      -        var GUtil = Graph.Util, viz = this.viz;
      -        for(var i=0; i<nodes.length; i++) {
      -            //TODO nodes are requested on demand, but not
      -            //deleted when hidden. Would that be a good feature? 
      -            //Currently that feature is buggy, so I'll turn it off
      -            //Actually this feature is buggy because trimming should take
      -            //place onAfterCompute and not right after collapsing nodes.
      -            if (true || !controller || !controller.request) {
      -                GUtil.eachLevel(nodes[i], 1, false, function(elem){
      -                    if (elem.exist) {
      -                        $extend(elem, {
      -                            'drawn': false,
      -                            'exist': false
      -                        });
      -                    }
      -                });
      -            } else {
      -                var ids = [];
      -                GUtil.eachLevel(nodes[i], 1, false, function(n) {
      -                    ids.push(n.id);
      -                });
      -                viz.op.removeNode(ids, { 'type': 'nothing' });
      -                viz.fx.clearLabels();
      -            }
      -        }
      -        controller.onComplete();
      -    },    
      -    
      -
      -    /*
      -    
      -       Expands group of nodes. 
      -    */
      -    expand: function(nodes, controller) {
      -        var that = this, GUtil = Graph.Util;
      -        this.show(nodes);
      -        this.animation.setOptions($merge(controller, {
      -            $animating: false,
      -            compute: function(delta) {
      -                that.plotStep(delta, controller, this.$animating);
      -                this.$animating = 'expand';
      -            },
      -            
      -            complete: function() {
      -                that.plotStep(undefined, controller, false);
      -                controller.onComplete();
      -            }       
      -        })).start();
      -        
      -    },
      -    
      -    show: function(nodes) {
      -        var GUtil = Graph.Util, config = this.config;
      -        this.prepare(nodes);
      -        $each(nodes, function(n) {
      -        	//check for root nodes if multitree
      -        	if(config.multitree && !('$orn' in n.data)) {
      -        		delete n.data.$orns;
      -        		var orns = ' ';
      -        		GUtil.eachSubnode(n, function(ch) {
      -        			if(('$orn' in ch.data) 
      -        					&& orns.indexOf(ch.data.$orn) < 0 
      -        					&& ch.exist && !ch.drawn) {
      -        				orns += ch.data.$orn + ' ';
      -        			}
      -        		});
      -        		n.data.$orns = orns;
      -        	}
      -            GUtil.eachLevel(n, 0, config.levelsToShow, function(n) {
      -            	if(n.exist) n.drawn = true;
      -            });     
      -        });
      -    },
      -    
      -    prepare: function(nodes) {
      -        this.nodes = this.getNodesWithChildren(nodes);
      -        return this.nodes;
      -    },
      -    
      -    /*
      -       Filters an array of nodes leaving only nodes with children.
      -    */
      -    getNodesWithChildren: function(nodes) {
      -        var ans = [], GUtil = Graph.Util, config = this.config, root = this.viz.root;
      -        nodes.sort(function(a, b) { return (a._depth <= b._depth) - (a._depth >= b._depth); });
      -        for(var i=0; i<nodes.length; i++) {
      -            if(GUtil.anySubnode(nodes[i], "exist")) {
      -            	for (var j = i+1, desc = false; !desc && j < nodes.length; j++) {
      -                    if(!config.multitree || '$orn' in nodes[j].data) {
      -                		desc = desc || GUtil.isDescendantOf(nodes[i], nodes[j].id);                    	
      -                    }
      -                }
      -                if(!desc) ans.push(nodes[i]);
      -            }
      -        }
      -        return ans;
      -    },
      -    
      -    plotStep: function(delta, controller, animating) {
      -        var viz = this.viz,
      -        config = this.config,
      -        canvas = viz.canvas, 
      -        ctx = canvas.getCtx(),
      -        nodes = this.nodes,
      -        GUtil = Graph.Util;
      -        var i, node;
      -        //hide nodes that are meant to be collapsed/expanded
      -        var nds = {};
      -        for(i=0; i<nodes.length; i++) {
      -          node = nodes[i];
      -          nds[node.id] = [];
      -          var root = config.multitree && !('$orn' in node.data);
      -          var orns = root && node.data.$orns;
      -          GUtil.eachSubgraph(node, function(n) { 
      -              //TODO(nico): Cleanup
      -        	  //special check for root node subnodes when
      -        	  //multitree is checked.
      -        	  if(root && orns && orns.indexOf(n.data.$orn) > 0 
      -        			  && n.drawn) {
      -        		  n.drawn = false;
      -                  nds[node.id].push(n);
      -              } else if((!root || !orns) && n.drawn) {
      -                n.drawn = false;
      -                nds[node.id].push(n);
      -              }
      -            });	
      -            node.drawn = true;
      -        }
      -        //plot the whole (non-scaled) tree
      -        if(nodes.length > 0) viz.fx.plot();
      -        //show nodes that were previously hidden
      -        for(i in nds) {
      -          $each(nds[i], function(n) { n.drawn = true; });
      -        }
      -        //plot each scaled subtree
      -        for(i=0; i<nodes.length; i++) {
      -          node = nodes[i];
      -          ctx.save();
      -          viz.fx.plotSubtree(node, controller, delta, animating);                
      -          ctx.restore();
      -        }
      -      },
      -
      -      getSiblings: function(nodes) {
      -        var siblings = {}, GUtil = Graph.Util;
      -        $each(nodes, function(n) {
      -            var par = GUtil.getParents(n);
      -            if (par.length == 0) {
      -                siblings[n.id] = [n];
      -            } else {
      -                var ans = [];
      -                GUtil.eachSubnode(par[0], function(sn) {
      -                    ans.push(sn);
      -                });
      -                siblings[n.id] = ans;
      -            }
      -        });
      -        return siblings;
      -    }
      -});
      -
      -/*
      -   Class: ST.Geom
      -
      -    Performs low level geometrical computations.
      -
      -   Access:
      -
      -   This instance can be accessed with the _geom_ parameter of the st instance created.
      -
      -   Example:
      -
      -   (start code js)
      -    var st = new ST(canvas, config);
      -    st.geom.translate //or can also call any other <ST.Geom> method
      -   (end code)
      -
      -*/
      -
      -ST.Geom = new Class({
      -    
      -    initialize: function(viz) {
      -        this.viz = viz;
      -        this.config = viz.config;
      -        this.node = viz.config.Node;
      -        this.edge = viz.config.Edge;
      -    },
      -    
      -    /*
      -       Method: translate
      -       
      -       Applies a translation to the tree.
      -
      -       Parameters:
      -
      -       pos - A <Complex> number specifying translation vector.
      -       prop - A <Graph.Node> position property ('pos', 'startPos' or 'endPos').
      -
      -       Example:
      -
      -       (start code js)
      -         st.geom.translate(new Complex(300, 100), 'endPos');
      -       (end code)
      -    */  
      -    translate: function(pos, prop) {
      -        prop = $splat(prop);
      -        Graph.Util.eachNode(this.viz.graph, function(elem) {
      -            $each(prop, function(p) { elem[p].$add(pos); });
      -        });
      -    },
      -
      -    /*
      -       Changes the tree current orientation to the one specified.
      -
      -       You should usually use <ST.switchPosition> instead.
      -    */  
      -    switchOrientation: function(orn) {
      -    	this.config.orientation = orn;
      -    },
      -
      -    /*
      -       Makes a value dispatch according to the current layout
      -       Works like a CSS property, either _top-right-bottom-left_ or _top|bottom - left|right_.
      -     */
      -    dispatch: function() {
      -    	//TODO(nico) should store Array.prototype.slice.call somewhere.
      -        var args = Array.prototype.slice.call(arguments);
      -        var s = args.shift(), len = args.length;
      -        var val = function(a) { return typeof a == 'function'? a() : a; };
      -        if(len == 2) {
      -            return (s == "top" || s == "bottom")? val(args[0]) : val(args[1]);
      -        } else if(len == 4) {
      -            switch(s) {
      -                case "top": return val(args[0]);
      -                case "right": return val(args[1]);
      -                case "bottom": return val(args[2]);
      -                case "left": return val(args[3]);
      -            }
      -        }
      -        return undefined;
      -    },
      -
      -    /*
      -       Returns label height or with, depending on the tree current orientation.
      -    */  
      -    getSize: function(n, invert) {
      -        var node = this.node, data = n.data, config = this.config;
      -        var cond = node.overridable, siblingOffset = config.siblingOffset;
      -        var s = (this.config.multitree 
      -        		&& ('$orn' in n.data) 
      -        		&& n.data.$orn) || this.config.orientation;
      -        var w = (cond && data.$width || node.width) + siblingOffset;
      -        var h = (cond && data.$height || node.height) + siblingOffset;
      -        if(!invert)
      -            return this.dispatch(s, h, w);
      -        else
      -            return this.dispatch(s, w, h);
      -    },
      -    
      -    /*
      -       Calculates a subtree base size. This is an utility function used by _getBaseSize_
      -    */  
      -    getTreeBaseSize: function(node, level, leaf) {
      -        var size = this.getSize(node, true), baseHeight = 0, that = this;
      -        if(leaf(level, node)) return size;
      -        if(level === 0) return 0;
      -        Graph.Util.eachSubnode(node, function(elem) {
      -            baseHeight += that.getTreeBaseSize(elem, level -1, leaf);
      -        });
      -        return (size > baseHeight? size : baseHeight) + this.config.subtreeOffset;
      -    },
      -
      -
      -    /*
      -       Method: getEdge
      -       
      -       Returns a Complex instance with the begin or end position of the edge to be plotted.
      -
      -       Parameters:
      -
      -       node - A <Graph.Node> that is connected to this edge.
      -       type - Returns the begin or end edge position. Possible values are 'begin' or 'end'.
      -
      -       Returns:
      -
      -       A <Complex> number specifying the begin or end position.
      -    */  
      -    getEdge: function(node, type, s) {
      -    	var $C = function(a, b) { 
      -          return function(){
      -            return node.pos.add(new Complex(a, b));
      -          }; 
      -        };
      -        var dim = this.node;
      -        var cond = this.node.overridable, data = node.data;
      -        var w = cond && data.$width || dim.width;
      -        var h = cond && data.$height || dim.height;
      -
      -        if(type == 'begin') {
      -            if(dim.align == "center") {
      -                return this.dispatch(s, $C(0, h/2), $C(-w/2, 0),
      -                                     $C(0, -h/2),$C(w/2, 0));
      -            } else if(dim.align == "left") {
      -                return this.dispatch(s, $C(0, h), $C(0, 0),
      -                                     $C(0, 0), $C(w, 0));
      -            } else if(dim.align == "right") {
      -                return this.dispatch(s, $C(0, 0), $C(-w, 0),
      -                                     $C(0, -h),$C(0, 0));
      -            } else throw "align: not implemented";
      -            
      -            
      -        } else if(type == 'end') {
      -            if(dim.align == "center") {
      -                return this.dispatch(s, $C(0, -h/2), $C(w/2, 0),
      -                                     $C(0, h/2),  $C(-w/2, 0));
      -            } else if(dim.align == "left") {
      -                return this.dispatch(s, $C(0, 0), $C(w, 0),
      -                                     $C(0, h), $C(0, 0));
      -            } else if(dim.align == "right") {
      -                return this.dispatch(s, $C(0, -h),$C(0, 0),
      -                                     $C(0, 0), $C(-w, 0));
      -            } else throw "align: not implemented";
      -        }
      -    },
      -
      -    /*
      -       Adjusts the tree position due to canvas scaling or translation.
      -    */  
      -    getScaledTreePosition: function(node, scale) {
      -        var dim = this.node;
      -        var cond = this.node.overridable, data = node.data;
      -        var w = (cond && data.$width || dim.width);
      -        var h = (cond && data.$height || dim.height);
      -        var s = (this.config.multitree 
      -        		&& ('$orn' in node.data) 
      -        		&& node.data.$orn) || this.config.orientation;
      -
      -        var $C = function(a, b) { 
      -          return function(){
      -            return node.pos.add(new Complex(a, b)).$scale(1 - scale);
      -          }; 
      -        };
      -        if(dim.align == "left") {
      -            return this.dispatch(s, $C(0, h), $C(0, 0),
      -                                 $C(0, 0), $C(w, 0));
      -        } else if(dim.align == "center") {
      -            return this.dispatch(s, $C(0, h / 2), $C(-w / 2, 0),
      -                                 $C(0, -h / 2),$C(w / 2, 0));
      -        } else if(dim.align == "right") {
      -            return this.dispatch(s, $C(0, 0), $C(-w, 0),
      -                                 $C(0, -h),$C(0, 0));
      -        } else throw "align: not implemented";
      -    },
      -
      -    /*
      -       Method: treeFitsInCanvas
      -       
      -       Returns a Boolean if the current subtree fits in canvas.
      -
      -       Parameters:
      -
      -       node - A <Graph.Node> which is the current root of the subtree.
      -       canvas - The <Canvas> object.
      -       level - The depth of the subtree to be considered.
      -    */  
      -    treeFitsInCanvas: function(node, canvas, level) {
      -        var csize = canvas.getSize(node);
      -        var s = (this.config.multitree 
      -        		&& ('$orn' in node.data) 
      -        		&& node.data.$orn) || this.config.orientation;
      -
      -        var size = this.dispatch(s, csize.width, csize.height);
      -        var baseSize = this.getTreeBaseSize(node, level, function(level, node) { 
      -          return level === 0 || !Graph.Util.anySubnode(node);
      -        });
      -        return (baseSize < size);
      -    },
      -    
      -    /*
      -       Hides levels of the tree until it properly fits in canvas.
      -    */  
      -    setRightLevelToShow: function(node, canvas) {
      -        var level = this.getRightLevelToShow(node, canvas), fx = this.viz.fx;
      -        Graph.Util.eachLevel(node, 0, this.config.levelsToShow, function(n) {
      -            var d = n._depth - node._depth;
      -            if(d > level) {
      -                n.drawn = false; 
      -                n.exist = false; 
      -                fx.hideLabel(n, false);
      -            } else {
      -                n.exist = true;
      -            }
      -        });
      -        node.drawn= true;
      -    },
      -    
      -    /*
      -       Returns the right level to show for the current tree in order to fit in canvas.
      -    */  
      -    getRightLevelToShow: function(node, canvas) {
      -        var config = this.config;
      -    	var level = config.levelsToShow;
      -    	var constrained = config.constrained;
      -        if(!constrained) return level;
      -        while(!this.treeFitsInCanvas(node, canvas, level) && level > 1) { level-- ; }
      -        return level;
      -    }
      -
      -});
      -
      -/*
      -   Object: ST.Plot
      -    
      -   Performs plotting operations.
      -
      -   Extends:
      -
      -   All <Graph.Plot> methods
      -
      -   Access:
      -
      -   This instance can be accessed with the _fx_ parameter of the st instance created.
      -
      -   Example:
      -
      -   (start code js)
      -    var st = new ST(canvas, config);
      -    st.fx.placeLabel //or can also call any other <ST.Plot> method
      -   (end code)
      -
      -
      -*/
      -ST.Plot = new Class({
      -    
      -    Implements: Graph.Plot,
      -    
      -    initialize: function(viz) {
      -        this.viz = viz;
      -        this.config = viz.config;
      -        this.node = this.config.Node;
      -        this.edge = this.config.Edge;
      -        this.animation = new Animation;
      -        this.nodeTypes = new ST.Plot.NodeTypes;
      -        this.edgeTypes = new ST.Plot.EdgeTypes;        
      -    },
      -    
      -    /*
      -       Plots a subtree from the spacetree.
      -    */
      -    plotSubtree: function(node, opt, scale, animating) {
      -        var viz = this.viz, canvas = viz.canvas;
      -        scale = Math.min(Math.max(0.001, scale), 1);
      -        if(scale >= 0) {
      -            node.drawn = false;     
      -            var ctx = canvas.getCtx();
      -            var diff = viz.geom.getScaledTreePosition(node, scale);
      -            ctx.translate(diff.x, diff.y);
      -            ctx.scale(scale, scale);
      -        }
      -        this.plotTree(node, !scale, opt, animating);
      -        if(scale >= 0) node.drawn = true;
      -    },
      -    /*
      -       Plots a Subtree.
      -    */
      -    plotTree: function(node, plotLabel, opt, animating) {
      -        var that = this, 
      -        viz = this.viz, 
      -        canvas = viz.canvas,
      -        config = this.config,
      -        ctx = canvas.getCtx();
      -        var root = config.multitree && !('$orn' in node.data);
      -        var orns = root && node.data.$orns;
      -        Graph.Util.eachSubnode(node, function(elem) {
      -            //multitree root node check
      -        	if((!root || orns.indexOf(elem.data.$orn) > 0)
      -        			&& elem.exist && elem.drawn) {
      -	            var adj = node.getAdjacency(elem.id);
      -	            !animating && opt.onBeforePlotLine(adj);
      -	            ctx.globalAlpha = Math.min(node.alpha, elem.alpha);
      -	            that.plotLine(adj, canvas, animating);
      -	            !animating && opt.onAfterPlotLine(adj);
      -	            that.plotTree(elem, plotLabel, opt, animating);
      -        	}
      -        });
      -
      -        if(node.drawn) {
      -            ctx.globalAlpha = node.alpha;
      -            !animating && opt.onBeforePlotNode(node);
      -            this.plotNode(node, canvas, animating);
      -            !animating && opt.onAfterPlotNode(node);
      -            if(plotLabel && ctx.globalAlpha >= 0.95) 
      -                this.plotLabel(canvas, node, opt);
      -            else 
      -                this.hideLabel(node, false);
      -        } else {
      -            this.hideLabel(node, true);
      -        }
      -    },
      -    
      -    /* 
      -      Method: placeLabel
      -
      -      Overrides abstract method placeLabel in <Graph.Plot>.
      -
      -      Parameters:
      -
      -      tag - A DOM label element.
      -      node - A <Graph.Node>.
      -      controller - A configuration/controller object passed to the visualization.
      -     
      -    */
      -    placeLabel: function(tag, node, controller) {
      -        var pos = node.pos.getc(true), dim = this.node, canvas = this.viz.canvas;
      -        var w = dim.overridable && node.data.$width || dim.width;
      -        var h = dim.overridable && node.data.$height || dim.height;
      -        var radius = canvas.getSize();
      -        var labelPos, orn;
      -        if(dim.align == "center") {
      -            labelPos= {
      -                x: Math.round(pos.x - w / 2 + radius.width/2),
      -                y: Math.round(pos.y - h / 2 + radius.height/2)
      -            };
      -        } else if (dim.align == "left") {
      -            orn = this.config.orientation;
      -            if(orn == "bottom" || orn == "top") {
      -                labelPos= {
      -                    x: Math.round(pos.x - w / 2 + radius.width/2),
      -                    y: Math.round(pos.y + radius.height/2)
      -                };
      -            } else {
      -                labelPos= {
      -                    x: Math.round(pos.x + radius.width/2),
      -                    y: Math.round(pos.y - h / 2 + radius.height/2)
      -                };
      -            }
      -        } else if(dim.align == "right") {
      -            orn = this.config.orientation;
      -            if(orn == "bottom" || orn == "top") {
      -                labelPos= {
      -                    x: Math.round(pos.x - w / 2 + radius.width/2),
      -                    y: Math.round(pos.y - h + radius.height/2)
      -                };
      -            } else {
      -                labelPos= {
      -                    x: Math.round(pos.x - w + radius.width/2),
      -                    y: Math.round(pos.y - h / 2 + radius.height/2)
      -                };
      -            }
      -        } else throw "align: not implemented";
      -
      -        var style = tag.style;
      -        style.left = labelPos.x + 'px';
      -        style.top  = labelPos.y + 'px';
      -        style.display = this.fitsInCanvas(labelPos, canvas)? '' : 'none';
      -        controller.onPlaceLabel(tag, node);
      -    },
      -    
      -    
      -    getAlignedPos: function(pos, width, height) {
      -        var nconfig = this.node;
      -        var square, orn;
      -        if(nconfig.align == "center") {
      -            square = {
      -                x: pos.x - width / 2,
      -                y: pos.y - height / 2
      -            };
      -        } else if (nconfig.align == "left") {
      -            orn = this.config.orientation;
      -            if(orn == "bottom" || orn == "top") {
      -                square = {
      -                    x: pos.x - width / 2,
      -                    y: pos.y
      -                };
      -            } else {
      -                square = {
      -                    x: pos.x,
      -                    y: pos.y - height / 2
      -                };
      -            }
      -        } else if(nconfig.align == "right") {
      -            orn = this.config.orientation;
      -            if(orn == "bottom" || orn == "top") {
      -                square = {
      -                    x: pos.x - width / 2,
      -                    y: pos.y - height
      -                };
      -            } else {
      -                square = {
      -                    x: pos.x - width,
      -                    y: pos.y - height / 2
      -                };
      -            }
      -        } else throw "align: not implemented";
      -        
      -        return square;
      -    },
      -    
      -    getOrientation: function(adj) {
      -    	var config = this.config;
      -    	var orn = config.orientation;
      -
      -    	if(config.multitree) {
      -        	var nodeFrom = adj.nodeFrom;
      -        	var nodeTo = adj.nodeTo;
      -    		orn = (('$orn' in nodeFrom.data) 
      -        		&& nodeFrom.data.$orn) 
      -        		|| (('$orn' in nodeTo.data) 
      -        		&& nodeTo.data.$orn);
      -    	}
      -
      -    	return orn; 
      -    }
      -});
      -
      -/*
      -  Class: ST.Plot.NodeTypes
      -
      -  Here are implemented all kinds of node rendering functions. 
      -  Rendering functions implemented are 'none', 'circle', 'ellipse', 'rectangle' and 'square'.
      -
      -  You can add new Node types by implementing a new method in this class
      -
      -  Example:
      -
      -  (start code js)
      -    ST.Plot.NodeTypes.implement({
      -      'newnodetypename': function(node, canvas) {
      -        //Render my node here.
      -      }
      -    });
      -  (end code)
      -
      -*/
      -ST.Plot.NodeTypes = new Class({
      -    'none': function() {},
      -    
      -    'circle': function(node, canvas) {
      -        var pos = node.pos.getc(true), nconfig = this.node, data = node.data;
      -        var cond = nconfig.overridable && data;
      -        var dim  = cond && data.$dim || nconfig.dim;
      -        var algnPos = this.getAlignedPos(pos, dim * 2, dim * 2);
      -        canvas.path('fill', function(context) {
      -            context.arc(algnPos.x + dim, algnPos.y + dim, dim, 0, Math.PI * 2, true);            
      -        });
      -    },
      -
      -    'square': function(node, canvas) {
      -        var pos = node.pos.getc(true), nconfig = this.node, data = node.data;
      -        var cond = nconfig.overridable && data;
      -        var dim  = cond && data.$dim || nconfig.dim;
      -        var algnPos = this.getAlignedPos(pos, dim, dim);
      -        canvas.getCtx().fillRect(algnPos.x, algnPos.y, dim, dim);
      -    },
      -
      -    'ellipse': function(node, canvas) {
      -        var pos = node.pos.getc(true), nconfig = this.node, data = node.data;
      -        var cond = nconfig.overridable && data;
      -        var width  = (cond && data.$width || nconfig.width) / 2;
      -        var height = (cond && data.$height || nconfig.height) / 2;
      -        var algnPos = this.getAlignedPos(pos, width * 2, height * 2);
      -        var ctx = canvas.getCtx();
      -        ctx.save();
      -        ctx.scale(width / height, height / width);
      -        canvas.path('fill', function(context) {
      -            context.arc((algnPos.x + width) * (height / width), (algnPos.y + height) * (width / height), height, 0, Math.PI * 2, true);            
      -        });
      -        ctx.restore();
      -    },
      -
      -    'rectangle': function(node, canvas) {
      -        var pos = node.pos.getc(true), nconfig = this.node, data = node.data;
      -        var cond = nconfig.overridable && data;
      -        var width  = cond && data.$width || nconfig.width;
      -        var height = cond && data.$height || nconfig.height;
      -        var algnPos = this.getAlignedPos(pos, width, height);
      -        canvas.getCtx().fillRect(algnPos.x, algnPos.y, width, height);
      -    }
      -});
      -
      -/*
      -  Class: ST.Plot.EdgeTypes
      -
      -  Here are implemented all kinds of edge rendering functions. 
      -  Rendering functions implemented are 'none', 'line', 'quadratic:begin', 'quadratic:end', 'bezier' and 'arrow'.
      -
      -  You can add new Edge types by implementing a new method in this class
      -
      -  Example:
      -
      -  (start code js)
      -    ST.Plot.EdgeTypes.implement({
      -      'newedgetypename': function(adj, canvas) {
      -        //Render my edge here.
      -      }
      -    });
      -  (end code)
      -
      -*/
      -ST.Plot.EdgeTypes = new Class({
      -    'none': function() {},
      -    
      -    'line': function(adj, canvas) {
      -    	var orn = this.getOrientation(adj);
      -    	var nodeFrom = adj.nodeFrom, nodeTo = adj.nodeTo;
      -        var begin = this.viz.geom.getEdge(nodeFrom._depth < nodeTo._depth? nodeFrom:nodeTo, 'begin', orn);
      -        var end =  this.viz.geom.getEdge(nodeFrom._depth < nodeTo._depth? nodeTo:nodeFrom, 'end', orn);
      -        canvas.path('stroke', function(ctx) {
      -            ctx.moveTo(begin.x, begin.y);
      -            ctx.lineTo(end.x, end.y);
      -        });
      -    },
      -    
      -    'quadratic:begin': function(adj, canvas) {
      -    	var orn = this.getOrientation(adj);
      -        var data = adj.data, econfig = this.edge;
      -    	var nodeFrom = adj.nodeFrom, nodeTo = adj.nodeTo;
      -        var begin = this.viz.geom.getEdge(nodeFrom._depth < nodeTo._depth? nodeFrom:nodeTo, 'begin', orn);
      -        var end =  this.viz.geom.getEdge(nodeFrom._depth < nodeTo._depth? nodeTo:nodeFrom, 'end', orn);
      -        var cond = econfig.overridable && data;
      -        var dim = cond && data.$dim || econfig.dim;
      -        switch(orn) {
      -            case "left":
      -                canvas.path('stroke', function(ctx){
      -                    ctx.moveTo(begin.x, begin.y);
      -                    ctx.quadraticCurveTo(begin.x + dim, begin.y, end.x, end.y);
      -                });
      -                break;
      -            case "right":
      -                canvas.path('stroke', function(ctx){
      -                    ctx.moveTo(begin.x, begin.y);
      -                    ctx.quadraticCurveTo(begin.x - dim, begin.y, end.x, end.y);
      -                });
      -                break;
      -            case "top":
      -                canvas.path('stroke', function(ctx){
      -                    ctx.moveTo(begin.x, begin.y);
      -                    ctx.quadraticCurveTo(begin.x, begin.y + dim, end.x, end.y);
      -                });
      -                break;
      -            case "bottom":
      -                canvas.path('stroke', function(ctx){
      -                    ctx.moveTo(begin.x, begin.y);
      -                    ctx.quadraticCurveTo(begin.x, begin.y - dim, end.x, end.y);
      -                });
      -                break;
      -        }
      -    },
      -
      -    'quadratic:end': function(adj, canvas) {
      -    	var orn = this.getOrientation(adj);
      -        var data = adj.data, econfig = this.edge;
      -    	var nodeFrom = adj.nodeFrom, nodeTo = adj.nodeTo;
      -        var begin = this.viz.geom.getEdge(nodeFrom._depth < nodeTo._depth? nodeFrom:nodeTo, 'begin', orn);
      -        var end =  this.viz.geom.getEdge(nodeFrom._depth < nodeTo._depth? nodeTo:nodeFrom, 'end', orn);
      -        var cond = econfig.overridable && data;
      -        var dim = cond && data.$dim || econfig.dim;
      -        switch(orn) {
      -            case "left":
      -                canvas.path('stroke', function(ctx){
      -                    ctx.moveTo(begin.x, begin.y);
      -                    ctx.quadraticCurveTo(end.x - dim, end.y, end.x, end.y);
      -                });
      -                break;
      -            case "right":
      -                canvas.path('stroke', function(ctx){
      -                    ctx.moveTo(begin.x, begin.y);
      -                    ctx.quadraticCurveTo(end.x + dim, end.y, end.x, end.y);
      -                });
      -                break;
      -            case "top":
      -                canvas.path('stroke', function(ctx){
      -                    ctx.moveTo(begin.x, begin.y);
      -                    ctx.quadraticCurveTo(end.x, end.y - dim, end.x, end.y);
      -                });
      -                break;
      -            case "bottom":
      -                canvas.path('stroke', function(ctx){
      -                    ctx.moveTo(begin.x, begin.y);
      -                    ctx.quadraticCurveTo(end.x, end.y + dim, end.x, end.y);
      -                });
      -                break;
      -        }
      -    },
      -
      -    'bezier': function(adj, canvas) {
      -        var data = adj.data, econfig = this.edge;
      -    	var orn = this.getOrientation(adj);
      -    	var nodeFrom = adj.nodeFrom, nodeTo = adj.nodeTo;
      -        var begin = this.viz.geom.getEdge(nodeFrom._depth < nodeTo._depth? nodeFrom:nodeTo, 'begin', orn);
      -        var end =  this.viz.geom.getEdge(nodeFrom._depth < nodeTo._depth? nodeTo:nodeFrom, 'end', orn);
      -        var cond = econfig.overridable && data;
      -        var dim = cond && data.$dim || econfig.dim;
      -        switch(orn) {
      -            case "left":
      -                canvas.path('stroke', function(ctx) {
      -                    ctx.moveTo(begin.x, begin.y);
      -                    ctx.bezierCurveTo(begin.x + dim, begin.y, end.x - dim, end.y, end.x, end.y);
      -                });
      -                break;
      -            case "right":
      -                canvas.path('stroke', function(ctx) {
      -                    ctx.moveTo(begin.x, begin.y);
      -                    ctx.bezierCurveTo(begin.x - dim, begin.y, end.x + dim, end.y, end.x, end.y);
      -                });
      -                break;
      -            case "top":
      -                canvas.path('stroke', function(ctx) {
      -                    ctx.moveTo(begin.x, begin.y);
      -                    ctx.bezierCurveTo(begin.x, begin.y + dim, end.x, end.y - dim, end.x, end.y);
      -                });
      -                break;
      -            case "bottom":
      -                canvas.path('stroke', function(ctx) {
      -                    ctx.moveTo(begin.x, begin.y);
      -                    ctx.bezierCurveTo(begin.x, begin.y - dim, end.x, end.y + dim, end.x, end.y);
      -                });
      -                break;
      -        }
      -    },
      -
      -    'arrow': function(adj, canvas) {
      -    	var orn = this.getOrientation(adj);
      -    	var node = adj.nodeFrom, child = adj.nodeTo;
      -        var data = adj.data, econfig = this.edge;
      -        //get edge dim
      -        var cond = econfig.overridable && data;
      -        var edgeDim = cond && data.$dim || econfig.dim;
      -        //get edge direction
      -        if(cond && data.$direction && data.$direction.length > 1) {
      -            var nodeHash = {};
      -            nodeHash[node.id] = node;
      -            nodeHash[child.id] = child;
      -            var sense = data.$direction;
      -            node = nodeHash[sense[0]];
      -            child = nodeHash[sense[1]];
      -        }
      -        var posFrom = this.viz.geom.getEdge(node, 'begin', orn);
      -        var posTo =  this.viz.geom.getEdge(child, 'end', orn);
      -        var vect = new Complex(posTo.x - posFrom.x, posTo.y - posFrom.y);
      -        vect.$scale(edgeDim / vect.norm());
      -        var intermediatePoint = new Complex(posTo.x - vect.x, posTo.y - vect.y);
      -        var normal = new Complex(-vect.y / 2, vect.x / 2);
      -        var v1 = intermediatePoint.add(normal), v2 = intermediatePoint.$add(normal.$scale(-1));
      -        canvas.path('stroke', function(context) {
      -            context.moveTo(posFrom.x, posFrom.y);
      -            context.lineTo(posTo.x, posTo.y);
      -        });
      -        canvas.path('fill', function(context) {
      -            context.moveTo(v1.x, v1.y);
      -            context.lineTo(v2.x, v2.y);
      -            context.lineTo(posTo.x, posTo.y);
      -        });
      -    }
      -});
      -
      -    
      -})();
      -
      -
      -
      -/*
      - * File: AngularWidth.js
      - * 
      - * Provides utility methods for calculating angular widths.
      - *
      - * Implemented by:
      - *
      - * <RGraph>, <Hypertree>
      - *
      - */
      -
      -/*
      -   Object: AngularWidth
      -
      -   Provides utility methods for calculating angular widths.
      -*/
      -var AngularWidth = {
      -    /*
      -     Method: setAngularWidthForNodes
      -    
      -     Sets nodes angular widths.
      -    */
      -    setAngularWidthForNodes: function() {
      -        var config = this.config.Node;
      -    var overridable = config.overridable;
      -    var dim = config.dim;
      -        
      -    Graph.Util.eachBFS(this.graph, this.root, function(elem, i) {
      -            var diamValue = (overridable 
      -       && elem.data 
      -       && elem.data.$aw) || dim;
      -            elem._angularWidth = diamValue / i;
      -        }, "ignore");
      -    },
      -    
      -    /*
      -     Method: setSubtreesAngularWidth
      -    
      -     Sets subtrees angular widths.
      -    */
      -    setSubtreesAngularWidth: function() {
      -        var that = this;
      -        Graph.Util.eachNode(this.graph, function(elem) {
      -            that.setSubtreeAngularWidth(elem);
      -        }, "ignore");
      -    },
      -    
      -    /*
      -     Method: setSubtreeAngularWidth
      -    
      -     Sets the angular width for a subtree.
      -    */
      -    setSubtreeAngularWidth: function(elem) {
      -        var that = this, nodeAW = elem._angularWidth, sumAW = 0;
      -        Graph.Util.eachSubnode(elem, function(child) {
      -            that.setSubtreeAngularWidth(child);
      -            sumAW += child._treeAngularWidth;
      -        }, "ignore");
      -        elem._treeAngularWidth = Math.max(nodeAW, sumAW);
      -    },
      -    
      -    /*
      -     Method: computeAngularWidths
      -    
      -     Computes nodes and subtrees angular widths.
      -    */
      -    computeAngularWidths: function () {
      -        this.setAngularWidthForNodes();
      -        this.setSubtreesAngularWidth();
      -    }
      -  
      -};
      -
      -
      -/*
      - * File: RGraph.js
      - * 
      - * Implements the <RGraph> class and other derived classes.
      - *
      - * Description:
      - *
      - * A radial layout of a tree puts the root node on the center of the canvas, places its children on the first concentric ring away from the root node, its grandchildren on a second concentric ring, and so on...
      - *
      - * Ka-Ping Yee, Danyel Fisher, Rachna Dhamija and Marti Hearst introduced a very interesting paper called "Animated Exploration of Dynamic Graphs with Radial Layout". In this paper they describe a way to animate a radial layout of a tree with ease-in and ease-out transitions, which make transitions from a graph's state to another easier to understand for the viewer.
      - *
      - * Inspired by:
      - *
      - * Animated Exploration of Dynamic Graphs with Radial Layout (Ka-Ping Yee, Danyel Fisher, Rachna Dhamija, Marti Hearst)
      - *
      - * <http://bailando.sims.berkeley.edu/papers/infovis01.htm>
      - *
      - * Disclaimer:
      - *
      - * This visualization was built from scratch, taking only the paper as inspiration, and only shares some features with this paper.
      - *
      - * 
      - */
      -
      -/*
      -   Class: RGraph
      -      
      -     The main RGraph class
      -
      -     Extends:
      -
      -     <Loader>, <AngularWidth>
      -
      -     Parameters:
      -
      -     canvas - A <Canvas> Class
      -     config - A configuration/controller object.
      -
      -     Configuration:
      -    
      -     The configuration object can have the following properties (all properties are optional and have a default value)
      -     
      -     *General*
      -
      -     - _interpolation_ Interpolation type used for animations. Possible options are 'polar' and 'linear'. Default's 'linear'.
      -     - _levelDistance_ Distance between a parent node and its children. Default's 100.
      -     - _withLabels_ Whether the visualization should use/create labels or not. Default's *true*.
      -
      -     *Node*
      -     
      -     Customize the visualization nodes' shape, color, and other style properties.
      -
      -     - _Node_
      -
      -     This object has as properties
      -
      -     - _overridable_ Determine whether or not nodes properties can be overriden by a particular node. Default's false.
      -
      -     If given a JSON tree or graph, a node _data_ property contains properties which are the same as defined here but prefixed with 
      -     a dollar sign (i.e $), the node properties will override the global node properties.
      -
      -     - _type_ Node type (shape). Possible options are "none", "square", "rectangle", "circle", "triangle", "star". Default's "circle".
      -     - _color_ Node color. Default's '#ccb'.
      -     - _lineWidth_ Line width. If nodes aren't drawn with strokes then this property won't be of any use. Default's 1.
      -     - _height_ Node height. Used for plotting rectangular nodes. Default's 5.
      -     - _width_ Node width. Used for plotting rectangular nodes. Default's 5.
      -     - _dim_ An extra parameter used by other complex shapes such as square and circle to determine the shape's diameter. Default's 3.
      -
      -     *Edge*
      -
      -     Customize the visualization edges' shape, color, and other style properties.
      -
      -     - _Edge_
      -
      -     This object has as properties
      -
      -     - _overridable_ Determine whether or not edges properties can be overriden by a particular edge object. Default's false.
      -
      -     If given a JSON _complex_ graph (defined in <Loader.loadJSON>), an adjacency _data_ property contains properties which are the same as defined here but prefixed with 
      -     a dollar sign (i.e $), the adjacency properties will override the global edge properties.
      -
      -     - _type_ Edge type (shape). Possible options are "none", "line" and "arrow". Default's "line".
      -     - _color_ Edge color. Default's '#ccb'.
      -     - _lineWidth_ Line width. If edges aren't drawn with strokes then this property won't be of any use. Default's 1.
      -
      -     *Animations*
      -
      -     - _duration_ Duration of the animation in milliseconds. Default's 2500.
      -     - _fps_ Frames per second. Default's 40.
      -     - _transition_ One of the transitions defined in the <Animation> class. Default's Quart.easeInOut.
      -     - _clearCanvas_ Whether to clear canvas on each animation frame or not. Default's true.
      -     
      -    *Controller options*
      -
      -    You can also implement controller functions inside the configuration object. This functions are
      -    
      -    - _onBeforeCompute(node)_ This method is called right before performing all computation and animations to the JIT visualization.
      -    - _onAfterCompute()_ This method is triggered right after all animations or computations for the JIT visualizations ended.
      -    - _onCreateLabel(domElement, node)_ This method receives the label dom element as first parameter, and the corresponding <Graph.Node> as second parameter. This method will only be called on label creation. Note that a <Graph.Node> is a node from the input tree/graph you provided to the visualization. If you want to know more about what kind of JSON tree/graph format is used to feed the visualizations, you can take a look at <Loader.loadJSON>. This method proves useful when adding events to the labels used by the JIT.
      -    - _onPlaceLabel(domElement, node)_ This method receives the label dom element as first parameter and the corresponding <Graph.Node> as second parameter. This method is called each time a label has been placed on the visualization, and thus it allows you to update the labels properties, such as size or position. Note that onPlaceLabel will be triggered after updating the labels positions. That means that, for example, the left and top css properties are already updated to match the nodes positions.
      -    - _onBeforePlotNode(node)_ This method is triggered right before plotting a given node. The _node_ parameter is the <Graph.Node> to be plotted. 
      -This method is useful for changing a node style right before plotting it.
      -    - _onAfterPlotNode(node)_ This method is triggered right after plotting a given node. The _node_ parameter is the <Graph.Node> plotted.
      -    - _onBeforePlotLine(adj)_ This method is triggered right before plotting an edge. The _adj_ parameter is a <Graph.Adjacence> object. 
      -This method is useful for adding some styles to a particular edge before being plotted.
      -    - _onAfterPlotLine(adj)_ This method is triggered right after plotting an edge. The _adj_ parameter is the <Graph.Adjacence> plotted.
      -
      -    Example:
      -
      -    Here goes a complete example. In most cases you won't be forced to implement all properties and methods. In fact, 
      -    all configuration properties  have the default value assigned.
      -
      -    I won't be instanciating a <Canvas> class here. If you want to know more about instanciating a <Canvas> class 
      -    please take a look at the <Canvas> class documentation.
      -
      -    (start code js)
      -      var rgraph = new RGraph(canvas, {
      -        interpolation: 'linear',
      -        levelDistance: 100,
      -        withLabels: true,
      -        Node: {
      -          overridable: false,
      -          type: 'circle',
      -          color: '#ccb',
      -          lineWidth: 1,
      -          height: 5,
      -          width: 5,
      -          dim: 3
      -        },
      -        Edge: {
      -          overridable: false,
      -          type: 'line',
      -          color: '#ccb',
      -          lineWidth: 1
      -        },
      -        duration: 2500,
      -        fps: 40,
      -        transition: Trans.Quart.easeInOut,
      -        clearCanvas: true,
      -        onBeforeCompute: function(node) {
      -          //do something onBeforeCompute
      -        },
      -        onAfterCompute:  function () {
      -          //do something onAfterCompute
      -        },
      -        onCreateLabel:   function(domElement, node) {
      -          //do something onCreateLabel
      -        },
      -        onPlaceLabel:    function(domElement, node) {
      -          //do something onPlaceLabel
      -        },
      -        onBeforePlotNode:function(node) {
      -          //do something onBeforePlotNode
      -        },
      -        onAfterPlotNode: function(node) {
      -          //do something onAfterPlotNode
      -        },
      -        onBeforePlotLine:function(adj) {
      -          //do something onBeforePlotLine
      -        },
      -        onAfterPlotLine: function(adj) {
      -          //do something onAfterPlotLine
      -        }
      -      });
      -    (end code)
      -
      -  Instance Properties:
      -
      -   - _graph_ Access a <Graph> instance.
      -   - _op_ Access a <RGraph.Op> instance.
      -   - _fx_ Access a <RGraph.Plot> instance.
      -*/
      -
      -this.RGraph = new Class({
      -  
      -    Implements: [Loader, AngularWidth],
      -    
      -  initialize: function(canvas, controller) {
      -    var config= {
      -            labelContainer: canvas.id + '-label',
      -
      -                interpolation: 'linear',
      -            levelDistance: 100,
      -            withLabels: true,
      -                
      -        Node: {
      -          overridable: false,
      -            type: 'circle',
      -          dim: 3,
      -          color: '#ccb',
      -                    width: 5,
      -                    height: 5,   
      -          lineWidth: 1
      -        },
      -        
      -        Edge: {
      -          overridable: false,
      -            type: 'line',
      -          color: '#ccb',
      -          lineWidth: 1
      -        },
      -
      -            fps:40,
      -            duration: 2500,
      -                transition: Trans.Quart.easeInOut,
      -                clearCanvas: true
      -    };
      -
      -      var innerController = {
      -          onBeforeCompute: $empty,
      -          onAfterCompute:  $empty,
      -          onCreateLabel:   $empty,
      -          onPlaceLabel:    $empty,
      -          onComplete:      $empty,
      -          onBeforePlotLine:$empty,
      -          onAfterPlotLine: $empty,
      -          onBeforePlotNode:$empty,
      -          onAfterPlotNode: $empty
      -      };
      -    
      -      this.controller = this.config = $merge(config, innerController, controller);
      -      this.graphOptions = {
      -            'complex': false,
      -            'Node': {
      -                'selected': false,
      -                'exist': true,
      -                'drawn': true
      -            }
      -        };
      -    this.graph = new Graph(this.graphOptions);
      -      this.fx = new RGraph.Plot(this);
      -    this.op = new RGraph.Op(this);
      -    this.json = null;
      -      this.canvas = canvas;
      -      this.root = null;
      -      this.busy = false;
      -      this.parent = false;
      -  },
      -    /* 
      -     Method: refresh 
      -     
      -     Computes nodes' positions and replots the tree.
      -
      -    */ 
      -    refresh: function() {
      -        this.compute();
      -        this.plot();
      -    },
      -    
      -    /*
      -     Method: reposition
      -    
      -     An alias for computing new positions to _endPos_
      -
      -     See also:
      -
      -     <RGraph.compute>
      -     
      -    */
      -    reposition: function() {
      -        this.compute('endPos');
      -    },
      -
      -
      -    /*
      -     Method: plot
      -    
      -     Plots the RGraph
      -    */
      -    plot: function() {
      -        this.fx.plot();
      -    },
      -    /* 
      -     Method: compute 
      -     
      -     Computes nodes' positions. 
      -
      -     Parameters:
      -
      -     property - _optional_ A <Graph.Node> position property to store the new positions. Possible values are 'pos', 'endPos' or 'startPos'.
      -
      -    */ 
      -    compute: function(property) {
      -        var prop = property || ['pos', 'startPos', 'endPos'];
      -        var node = this.graph.getNode(this.root);
      -        node._depth = 0;
      -        Graph.Util.computeLevels(this.graph, this.root, 0, "ignore");
      -        this.computeAngularWidths();
      -        this.computePositions(prop);
      -    },
      -    
      -    /*
      -     computePositions
      -    
      -     Performs the main algorithm for computing node positions.
      -    */
      -    computePositions: function(property) {
      -        var propArray = $splat(property);
      -        var aGraph = this.graph;
      -        var GUtil = Graph.Util;
      -        var root = this.graph.getNode(this.root);
      -        var parent = this.parent;
      -    var config = this.config;
      -
      -        for(var i=0; i<propArray.length; i++)
      -            root[propArray[i]] = $P(0, 0);
      -        
      -        root.angleSpan = {
      -            begin: 0,
      -            end: 2 * Math.PI
      -        };
      -        root._rel = 1;
      -        
      -        GUtil.eachBFS(this.graph, this.root, function (elem) {
      -            var angleSpan = elem.angleSpan.end - elem.angleSpan.begin;
      -            var rho = (elem._depth + 1) * config.levelDistance;
      -            var angleInit = elem.angleSpan.begin;
      -            
      -      var totalAngularWidths = 0, subnodes = [];
      -            GUtil.eachSubnode(elem, function(sib) {
      -                totalAngularWidths += sib._treeAngularWidth;
      -        subnodes.push(sib);
      -            }, "ignore");
      -            
      -            if(parent && parent.id == elem.id && subnodes.length > 0 && subnodes[0].dist) {
      -                subnodes.sort(function(a, b) {
      -                    return  (a.dist >= b.dist) - (a.dist <= b.dist);
      -                });
      -            }
      -            for(var k=0; k < subnodes.length; k++) {
      -                var child = subnodes[k];
      -                if(!child._flag) {
      -                    child._rel = child._treeAngularWidth / totalAngularWidths;
      -                    var angleProportion = child._rel * angleSpan;
      -                    var theta = angleInit + angleProportion / 2;
      -
      -                    for(var i=0; i<propArray.length; i++)
      -                        child[propArray[i]] = $P(theta, rho);
      -
      -                    child.angleSpan = {
      -                        begin: angleInit,
      -                        end: angleInit + angleProportion
      -                    };
      -                    angleInit += angleProportion;
      -                }
      -            }
      -        }, "ignore");
      -    },
      -
      -    /*
      -     getNodeAndParentAngle
      -    
      -     Returns the _parent_ of the given node, also calculating its angle span.
      -    */
      -    getNodeAndParentAngle: function(id) {
      -        var theta = false;
      -        var n  = this.graph.getNode(id);
      -        var ps = Graph.Util.getParents(n);
      -        var p  = (ps.length > 0)? ps[0] : false;
      -        if(p) {
      -            var posParent = p.pos.getc(), posChild = n.pos.getc();
      -            var newPos    = posParent.add(posChild.scale(-1));
      -            theta = Math.atan2(newPos.y, newPos.x);
      -            if(theta < 0) theta += 2 * Math.PI;
      -        }
      -        return {parent: p, theta: theta};
      -    },
      -    
      -    /*
      -     tagChildren
      -    
      -     Enumerates the children in order to mantain child ordering (second constraint of the paper).
      -    */
      -    tagChildren: function(par, id) {
      -        if(par.angleSpan) {
      -          var adjs = [];
      -          Graph.Util.eachAdjacency(par, function(elem) {
      -            adjs.push(elem.nodeTo);
      -          }, "ignore");
      -          var len = adjs.length;
      -          for(var i=0; i < len && id != adjs[i].id; i++);
      -          for(var j= (i+1) % len, k = 0; id !=  adjs[j].id; j = (j+1) % len) {
      -            adjs[j].dist = k++;
      -          }
      -        }
      -    },
      -    
      -     /* 
      -     Method: onClick 
      -     
      -     Performs all calculations and animations to center the node specified by _id_.
      -
      -     Parameters:
      -
      -     id - A <Graph.Node> id.
      -     opt - _optional_ An object containing some extra properties like
      -
      -     - _hideLabels_ Hide labels when performing the animation. Default's *true*.
      -
      -     Example:
      -
      -     (start code js)
      -       rgraph.onClick('someid');
      -       //or also...
      -       rgraph.onClick('someid', {
      -        hideLabels: false
      -       });
      -      (end code)
      -      
      -    */ 
      -    onClick: function(id, opt) {
      -        if(this.root != id && !this.busy) {
      -            this.busy = true;
      -            this.root = id; 
      -            that = this;
      -            this.controller.onBeforeCompute(this.graph.getNode(id));
      -            var obj = this.getNodeAndParentAngle(id);
      -            
      -      //second constraint
      -      this.tagChildren(obj.parent, id);
      -            this.parent = obj.parent;
      -            this.compute('endPos');
      -            
      -            //first constraint
      -            var thetaDiff = obj.theta - obj.parent.endPos.theta;
      -            Graph.Util.eachNode(this.graph, function(elem) {
      -                elem.endPos.set(elem.endPos.getp().add($P(thetaDiff, 0)));
      -            });
      -
      -            var mode = this.config.interpolation;
      -            opt = $merge({ onComplete: $empty }, opt || {});
      -
      -      this.fx.animate($merge({
      -                hideLabels: true,
      -                modes: [mode]
      -            }, opt, {
      -                onComplete: function() {
      -                    that.busy = false;
      -                    opt.onComplete();
      -                }
      -            }));
      -        }       
      -    }
      -});
      -
      -/*
      -   Class: RGraph.Op
      -
      -   Performs advanced operations on trees and graphs.
      -
      -   Extends:
      -
      -   All <Graph.Op> methods
      -
      -   Access:
      -
      -   This instance can be accessed with the _op_ parameter of the <RGraph> instance created.
      -
      -   Example:
      -
      -   (start code js)
      -    var rgraph = new RGraph(canvas, config);
      -    rgraph.op.morph //or can also call any other <Graph.Op> method
      -   (end code)
      -   
      -*/
      -RGraph.Op = new Class({
      -
      -    Implements: Graph.Op,
      -
      -    initialize: function(viz) {
      -        this.viz = viz;
      -    }
      -});
      -
      -/*
      -   Class: RGraph.Plot
      -
      -   Performs plotting operations.
      -
      -   Extends:
      -
      -   All <Graph.Plot> methods
      -
      -   Access:
      -
      -   This instance can be accessed with the _fx_ parameter of the <RGraph> instance created.
      -
      -   Example:
      -
      -   (start code js)
      -    var rgraph = new RGraph(canvas, config);
      -    rgraph.fx.placeLabel //or can also call any other <RGraph.Plot> method
      -   (end code)
      -
      -*/
      -RGraph.Plot = new Class({
      -  
      -  Implements: Graph.Plot,
      -  
      -    initialize: function(viz) {
      -        this.viz = viz;
      -    this.config = viz.config;
      -    this.node = viz.config.Node;
      -    this.edge = viz.config.Edge;
      -    this.animation = new Animation;
      -      this.nodeTypes = new RGraph.Plot.NodeTypes;
      -    this.edgeTypes = new RGraph.Plot.EdgeTypes;
      -    },
      -
      -    /* 
      -      Method: placeLabel
      -
      -      Overrides abstract method placeLabel in <Graph.Plot>.
      -
      -      Parameters:
      -
      -      tag - A DOM label element.
      -      node - A <Graph.Node>.
      -      controller - A configuration/controller object passed to the visualization.
      -     
      -     */
      -    placeLabel: function(tag, node, controller) {
      -        var pos = node.pos.getc(true), canvas = this.viz.canvas; 
      -        var radius= canvas.getSize();
      -        var labelPos= {
      -            x: Math.round(pos.x + radius.width/2),
      -            y: Math.round(pos.y + radius.height/2)
      -        };
      -        var style = tag.style;
      -        style.left = labelPos.x + 'px';
      -        style.top  = labelPos.y + 'px';
      -        style.display = this.fitsInCanvas(labelPos, canvas)? '' : 'none';
      -        controller.onPlaceLabel(tag, node);
      -  }
      -});
      -
      -/*
      -  Class: RGraph.Plot.NodeTypes
      -
      -  Here are implemented all kinds of node rendering functions. 
      -  Rendering functions implemented are 'none', 'circle', 'triangle', 'rectangle', 'star' and 'square'.
      -
      -  You can add new Node types by implementing a new method in this class
      -
      -  Example:
      -
      -  (start code js)
      -    RGraph.Plot.NodeTypes.implement({
      -      'newnodetypename': function(node, canvas) {
      -        //Render my node here.
      -      }
      -    });
      -  (end code)
      -
      -*/
      -RGraph.Plot.NodeTypes = new Class({
      -    'none': function() {},
      -    
      -    'circle': function(node, canvas) {
      -        var pos = node.pos.getc(true), nconfig = this.node, data = node.data;
      -        var nodeDim = nconfig.overridable && data && data.$dim || nconfig.dim;
      -        canvas.path('fill', function(context) {
      -            context.arc(pos.x, pos.y, nodeDim, 0, Math.PI*2, true);            
      -        });
      -    },
      -    
      -    'square': function(node, canvas) {
      -        var pos = node.pos.getc(true), nconfig = this.node, data = node.data;
      -        var nodeDim = nconfig.overridable && data && data.$dim || nconfig.dim;
      -    var nodeDim2 = 2 * nodeDim;
      -        canvas.getCtx().fillRect(pos.x - nodeDim, pos.y - nodeDim, nodeDim2, nodeDim2);
      -    },
      -    
      -    'rectangle': function(node, canvas) {
      -        var pos = node.pos.getc(true), nconfig = this.node, data = node.data;
      -        var width = nconfig.overridable && data && data.$width || nconfig.width;
      -    var height = nconfig.overridable && data && data.$height || nconfig.height;
      -        canvas.getCtx().fillRect(pos.x - width / 2, pos.y - height / 2, width, height);
      -    },
      -    
      -    'triangle': function(node, canvas) {
      -        var pos = node.pos.getc(true), nconfig = this.node, data = node.data;
      -        var nodeDim = nconfig.overridable && data && data.$dim || nconfig.dim;
      -        var c1x = pos.x, c1y = pos.y - nodeDim,
      -        c2x = c1x - nodeDim, c2y = pos.y + nodeDim,
      -        c3x = c1x + nodeDim, c3y = c2y;
      -        canvas.path('fill', function(ctx) {
      -            ctx.moveTo(c1x, c1y);
      -            ctx.lineTo(c2x, c2y);
      -            ctx.lineTo(c3x, c3y);
      -        });
      -    },
      -    
      -    'star': function(node, canvas) {
      -        var pos = node.pos.getc(true), nconfig = this.node, data = node.data;
      -        var nodeDim = nconfig.overridable && data && data.$dim || nconfig.dim;
      -        var ctx = canvas.getCtx(), pi5 = Math.PI / 5;
      -        ctx.save();
      -        ctx.translate(pos.x, pos.y);
      -        ctx.beginPath();
      -        ctx.moveTo(nodeDim, 0);
      -        for (var i=0; i<9; i++){
      -          ctx.rotate(pi5);
      -          if(i % 2 == 0) {
      -            ctx.lineTo((nodeDim / 0.525731) * 0.200811, 0);
      -          } else {
      -            ctx.lineTo(nodeDim, 0);
      -          }
      -        }
      -        ctx.closePath();
      -        ctx.fill();
      -        ctx.restore();
      -    }
      -});
      -
      -/*
      -  Class: RGraph.Plot.EdgeTypes
      -
      -  Here are implemented all kinds of edge rendering functions. 
      -  Rendering functions implemented are 'none', 'line' and 'arrow'.
      -
      -  You can add new Edge types by implementing a new method in this class
      -
      -  Example:
      -
      -  (start code js)
      -    RGraph.Plot.EdgeTypes.implement({
      -      'newedgetypename': function(adj, canvas) {
      -        //Render my edge here.
      -      }
      -    });
      -  (end code)
      -
      -*/
      -RGraph.Plot.EdgeTypes = new Class({
      -    'none': function() {},
      -    
      -    'line': function(adj, canvas) {
      -        var pos = adj.nodeFrom.pos.getc(true);
      -    var posChild = adj.nodeTo.pos.getc(true);
      -        canvas.path('stroke', function(context) {
      -            context.moveTo(pos.x, pos.y);
      -            context.lineTo(posChild.x, posChild.y);
      -        });
      -    },
      -    
      -    'arrow': function(adj, canvas) {
      -        var node = adj.nodeFrom, child = adj.nodeTo;
      -    var data = adj.data, econfig = this.edge;
      -        //get edge dim
      -    var cond = econfig.overridable && data;
      -    var edgeDim = cond && data.$dim || 14;
      -        //get edge direction
      -        if(cond && data.$direction && data.$direction.length > 1) {
      -            var nodeHash = {};
      -            nodeHash[node.id] = node;
      -            nodeHash[child.id] = child;
      -            var sense = data.$direction;
      -            node = nodeHash[sense[0]];
      -            child = nodeHash[sense[1]];
      -        }
      -        var posFrom = node.pos.getc(true), posTo = child.pos.getc(true);
      -        var vect = new Complex(posTo.x - posFrom.x, posTo.y - posFrom.y);
      -        vect.$scale(edgeDim / vect.norm());
      -        var intermediatePoint = new Complex(posTo.x - vect.x, posTo.y - vect.y);
      -        var normal = new Complex(-vect.y / 2, vect.x / 2);
      -        var v1 = intermediatePoint.add(normal), v2 = intermediatePoint.$add(normal.$scale(-1));
      -        canvas.path('stroke', function(context) {
      -            context.moveTo(posFrom.x, posFrom.y);
      -            context.lineTo(posTo.x, posTo.y);
      -        });
      -    canvas.path('fill', function(context) {
      -            context.moveTo(v1.x, v1.y);
      -            context.lineTo(v2.x, v2.y);
      -            context.lineTo(posTo.x, posTo.y);
      -        });
      -  }
      -});
      -
      -
      -/*
      - * File: Hypertree.js
      - * 
      - * Implements the <Hypertree> class and other derived classes.
      - *
      - * Description:
      - *
      - * A Hyperbolic Tree (HT) is a focus+context information visualization technique used to display large amount of inter-related data. This technique was originally developed at Xerox PARC.
      - *
      - * The HT algorithm plots a tree in what's called the Poincare Disk model of Hyperbolic Geometry, a kind of non-Euclidean geometry. By doing this, the HT algorithm applies a moebius transformation to the tree in order to display it with a magnifying glass effect.
      - *
      - * Inspired by:
      - *
      - * A Focus+Context Technique Based on Hyperbolic Geometry for Visualizing Large Hierarchies (John Lamping, Ramana Rao, and Peter Pirolli).
      - *
      - * <http://www.cs.tau.ac.il/~asharf/shrek/Projects/HypBrowser/startree-chi95.pdf>
      - *
      - * Disclaimer:
      - *
      - * This visualization was built from scratch, taking only the paper as inspiration, and only shares some features with the Hypertree.
      - *
      -
      -*/
      -
      -/* 
      -     Complex 
      -     
      -     A multi-purpose Complex Class with common methods. Exetended for the Hypertree. 
      - 
      -*/ 
      -/* 
      -   moebiusTransformation 
      - 
      -   Calculates a moebius transformation for this point / complex. 
      -    For more information go to: 
      -        http://en.wikipedia.org/wiki/Moebius_transformation. 
      - 
      -   Parameters: 
      - 
      -      c - An initialized Complex instance representing a translation Vector. 
      -*/ 
      - 
      -Complex.prototype.moebiusTransformation = function(c) { 
      -    var num = this.add(c); 
      -    var den = c.$conjugate().$prod(this); den.x++; 
      -    return num.$div(den); 
      -}; 
      - 
      -/* 
      -   Method: getClosestNodeToOrigin 
      - 
      -   Extends <Graph.Util>. Returns the closest node to the center of canvas.
      -
      -   Parameters:
      -  
      -    graph - A <Graph> instance.
      -    prop - _optional_ a <Graph.Node> position property. Possible properties are 'startPos', 'pos' or 'endPos'. Default's 'pos'.
      -
      -   Returns:
      -
      -    Closest node to origin. Returns *null* otherwise.
      -  
      -*/ 
      -Graph.Util.getClosestNodeToOrigin = function(graph, prop, flags) { 
      -    return this.getClosestNodeToPos(graph, Polar.KER, prop, flags);
      -}; 
      -
      -/* 
      -   Method: getClosestNodeToPos
      - 
      -   Extends <Graph.Util>. Returns the closest node to the given position.
      -
      -   Parameters:
      -  
      -    graph - A <Graph> instance.
      -    p[os - A <Complex> or <Polar> instance.
      -    prop - _optional_ a <Graph.Node> position property. Possible properties are 'startPos', 'pos' or 'endPos'. Default's 'pos'.
      -
      -   Returns:
      -
      -    Closest node to the given position. Returns *null* otherwise.
      -  
      -*/ 
      -Graph.Util.getClosestNodeToPos = function(graph, pos, prop, flags) { 
      -  var node = null; prop = prop || 'pos'; pos = pos && pos.getc(true) || Complex.KER;
      -  var distance = function(a, b) { 
      -    var d1 = a.x - b.x, d2 = a.y - b.y;
      -    return d1 * d1 + d2 * d2;
      -  };
      -  this.eachNode(graph, function(elem) { 
      -    node = (node == null || distance(elem[prop].getc(true), pos) < distance(node[prop].getc(true), pos))? elem : node; 
      -  }, flags); 
      -  return node; 
      -}; 
      -
      -/* 
      -    moebiusTransformation 
      -     
      -    Calculates a moebius transformation for the hyperbolic tree. 
      -     
      -    <http://en.wikipedia.org/wiki/Moebius_transformation> 
      -      
      -     Parameters: 
      -     
      -        graph - A <Graph> instance.
      -        pos - A <Complex>.
      -        prop - A property array.
      -        theta - Rotation angle. 
      -        startPos - _optional_ start position. 
      -*/   
      -Graph.Util.moebiusTransformation = function(graph, pos, prop, startPos, flags) { 
      -    this.eachNode(graph, function(elem) { 
      -        for(var i=0; i<prop.length; i++) { 
      -            var p = pos[i].scale(-1), property = startPos? startPos : prop[i];  
      -            elem[prop[i]].set(elem[property].getc().moebiusTransformation(p)); 
      -        } 
      -    }, flags); 
      -}; 
      - 
      -/* 
      -   Class: Hypertree 
      -      
      -     The main Hypertree class
      -
      -     Extends:
      -
      -     <Loader>, <AngularWidth>
      -
      -     Parameters:
      -
      -     canvas - A <Canvas> Class
      -     config - A configuration/controller object.
      -
      -     Configuration:
      -    
      -     The configuration object can have the following properties (all properties are optional and have a default value)
      -      
      -     *General*
      -     - _withLabels_ Whether the visualization should use/create labels or not. Default's *true*.
      -     
      -     *Node*
      -     
      -     Customize the visualization nodes' shape, color, and other style properties.
      -
      -     - _Node_
      -
      -     This object has as properties
      -
      -     - _overridable_ Determine whether or not nodes properties can be overriden by a particular node. Default's false.
      -
      -     If given a JSON tree or graph, a node _data_ property contains properties which are the same as defined here but prefixed with 
      -     a dollar sign (i.e $), the node properties will override the global node properties.
      -
      -     - _type_ Node type (shape). Possible options are "none", "square", "rectangle", "circle", "triangle", "star". Default's "circle".
      -     - _color_ Node color. Default's '#ccb'.
      -     - _lineWidth_ Line width. If nodes aren't drawn with strokes then this property won't be of any use. Default's 1.
      -     - _height_ Node height. Used for plotting rectangular nodes. Default's 5.
      -     - _width_ Node width. Used for plotting rectangular nodes. Default's 5.
      -     - _dim_ An extra parameter used by other complex shapes such as square and circle to determine the shape's diameter. Default's 7.
      -     - _transform_ Whether to apply the moebius transformation to the nodes or not. Default's true.
      -
      -     *Edge*
      -
      -     Customize the visualization edges' shape, color, and other style properties.
      -
      -     - _Edge_
      -
      -     This object has as properties
      -
      -     - _overridable_ Determine whether or not edges properties can be overriden by a particular edge object. Default's false.
      -
      -     If given a JSON _complex_ graph (defined in <Loader.loadJSON>), an adjacency _data_ property contains properties which are the same as defined here but prefixed with 
      -     a dollar sign (i.e $), the adjacency properties will override the global edge properties.
      -
      -     - _type_ Edge type (shape). Possible options are "none", "line" and "hyperline". Default's "hyperline".
      -     - _color_ Edge color. Default's '#ccb'.
      -     - _lineWidth_ Line width. If edges aren't drawn with strokes then this property won't be of any use. Default's 1.
      -
      -     *Animations*
      -
      -     - _duration_ Duration of the animation in milliseconds. Default's 1500.
      -     - _fps_ Frames per second. Default's 40.
      -     - _transition_ One of the transitions defined in the <Animation> class. Default's Quart.easeInOut.
      -     - _clearCanvas_ Whether to clear canvas on each animation frame or not. Default's true.
      -
      -    *Controller options*
      -
      -    You can also implement controller functions inside the configuration object. This functions are
      -    
      -    - _onBeforeCompute(node)_ This method is called right before performing all computation and animations to the JIT visualization.
      -    - _onAfterCompute()_ This method is triggered right after all animations or computations for the JIT visualizations ended.
      -    - _onCreateLabel(domElement, node)_ This method receives the label dom element as first parameter, and the corresponding <Graph.Node> as second parameter. This method will only be called on label creation. Note that a <Graph.Node> is a node from the input tree/graph you provided to the visualization. If you want to know more about what kind of JSON tree/graph format is used to feed the visualizations, you can take a look at <Loader.loadJSON>. This method proves useful when adding events to the labels used by the JIT.
      -    - _onPlaceLabel(domElement, node)_ This method receives the label dom element as first parameter and the corresponding <Graph.Node> as second parameter. This method is called each time a label has been placed on the visualization, and thus it allows you to update the labels properties, such as size or position. Note that onPlaceLabel will be triggered after updating the labels positions. That means that, for example, the left and top css properties are already updated to match the nodes positions.
      -    - _onBeforePlotNode(node)_ This method is triggered right before plotting a given node. The _node_ parameter is the <Graph.Node> to be plotted. 
      -This method is useful for changing a node style right before plotting it.
      -    - _onAfterPlotNode(node)_ This method is triggered right after plotting a given node. The _node_ parameter is the <Graph.Node> plotted.
      -    - _onBeforePlotLine(adj)_ This method is triggered right before plotting an edge. The _adj_ parameter is a <Graph.Adjacence> object. 
      -This method is useful for adding some styles to a particular edge before being plotted.
      -    - _onAfterPlotLine(adj)_ This method is triggered right after plotting an edge. The _adj_ parameter is the <Graph.Adjacence> plotted.
      -
      -    Example:
      -
      -    Here goes a complete example. In most cases you won't be forced to implement all properties and methods. In fact, 
      -    all configuration properties  have the default value assigned.
      -
      -    I won't be instanciating a <Canvas> class here. If you want to know more about instanciating a <Canvas> class 
      -    please take a look at the <Canvas> class documentation.
      -
      -    (start code js)
      -      var ht = new Hypertree(canvas, {
      -        
      -        Node: {
      -          overridable: false,
      -          type: 'circle',
      -          color: '#ccb',
      -          lineWidth: 1,
      -          height: 5,
      -          width: 5,
      -          dim: 7,
      -          transform: true
      -        },
      -        Edge: {
      -          overridable: false,
      -          type: 'hyperline',
      -          color: '#ccb',
      -          lineWidth: 1
      -        },
      -        duration: 1500,
      -        fps: 40,
      -        transition: Trans.Quart.easeInOut,
      -        clearCanvas: true,
      -        withLabels: true,
      -        
      -        onBeforeCompute: function(node) {
      -          //do something onBeforeCompute
      -        },
      -        onAfterCompute:  function () {
      -          //do something onAfterCompute
      -        },
      -        onCreateLabel:   function(domElement, node) {
      -          //do something onCreateLabel
      -        },
      -        onPlaceLabel:    function(domElement, node) {
      -          //do something onPlaceLabel
      -        },
      -        onBeforePlotNode:function(node) {
      -          //do something onBeforePlotNode
      -        },
      -        onAfterPlotNode: function(node) {
      -          //do something onAfterPlotNode
      -        },
      -        onBeforePlotLine:function(adj) {
      -          //do something onBeforePlotLine
      -        },
      -        onAfterPlotLine: function(adj) {
      -          //do something onAfterPlotLine
      -        }
      -      });
      -    (end code)
      -
      -    Instance Properties:
      -
      -    - _graph_ Access a <Graph> instance.
      -    - _op_ Access a <Hypertree.Op> instance.
      -    - _fx_ Access a <Hypertree.Plot> instance.
      -*/ 
      - 
      -this.Hypertree = new Class({ 
      -   
      -  Implements: [Loader, AngularWidth], 
      -   
      -  initialize: function(canvas, controller) { 
      - 
      -    var config = { 
      -                labelContainer: canvas.id + '-label', 
      -             
      -                withLabels: true,
      -                
      -                Node: { 
      -                    overridable: false, 
      -                    type: 'circle', 
      -                    dim: 7, 
      -                    color: '#ccb', 
      -                    width: 5, 
      -                    height: 5,    
      -                    lineWidth: 1, 
      -                    transform: true 
      -                }, 
      -                 
      -                Edge: { 
      -                    overridable: false, 
      -                    type: 'hyperline', 
      -                    color: '#ccb', 
      -                    lineWidth: 1 
      -                }, 
      -                clearCanvas: true,
      -            fps:40, 
      -            duration: 1500, 
      -                transition: Trans.Quart.easeInOut 
      -    }; 
      - 
      -      var innerController = { 
      -          onBeforeCompute: $empty, 
      -          onAfterCompute:  $empty, 
      -          onCreateLabel:   $empty, 
      -          onPlaceLabel:    $empty, 
      -          onComplete:      $empty, 
      -          onBeforePlotLine:$empty, 
      -          onAfterPlotLine: $empty, 
      -          onBeforePlotNode:$empty, 
      -          onAfterPlotNode: $empty 
      -      }; 
      -       
      -      this.controller = this.config = $merge(config, innerController, controller); 
      -        this.graphOptions = { 
      -            'complex': false, 
      -            'Node': { 
      -                'selected': false, 
      -                'exist': true, 
      -                'drawn': true 
      -            } 
      -        }; 
      -    this.graph = new Graph(this.graphOptions); 
      -    this.fx = new Hypertree.Plot(this); 
      -    this.op = new Hypertree.Op(this); 
      -      this.json = null; 
      -      this.canvas = canvas; 
      - 
      -      this.root = null; 
      -      this.busy = false; 
      -    }, 
      - 
      -    /* 
      -     Method: refresh 
      -     
      -     Computes nodes' positions and replots the tree.
      -
      -     Parameters:
      -
      -     reposition - _optional_ Set this to *true* to force repositioning.
      -
      -     See also:
      -
      -     <Hypertree.reposition>
      -      
      -    */ 
      -    refresh: function(reposition) { 
      -        if(reposition) { 
      -            this.reposition(); 
      -            Graph.Util.eachNode(this.graph, function(node) { 
      -                node.startPos.rho = node.pos.rho = node.endPos.rho;
      -                node.startPos.theta = node.pos.theta = node.endPos.theta; 
      -            }); 
      -        } else { 
      -            this.compute(); 
      -        } 
      -        this.plot(); 
      -    }, 
      -     
      -    /* 
      -     Method: reposition 
      -     
      -     Computes nodes' positions and restores the tree to its previous position.
      -
      -     For calculating nodes' positions the root must be placed on its origin. This method does this 
      -       and then attemps to restore the hypertree to its previous position.
      -      
      -    */ 
      -    reposition: function() { 
      -        this.compute('endPos'); 
      -        var vector = this.graph.getNode(this.root).pos.getc().scale(-1); 
      -        Graph.Util.moebiusTransformation(this.graph, [vector], ['endPos'], 'endPos', "ignore"); 
      -        Graph.Util.eachNode(this.graph, function(node) { 
      -            if (node.ignore) {
      -                node.endPos.rho = node.pos.rho;
      -                node.endPos.theta = node.pos.theta;
      -            } 
      -        }); 
      -    }, 
      - 
      -    /* 
      -     Method: plot 
      -     
      -     Plots the Hypertree 
      -
      -    */ 
      -    plot: function() { 
      -        this.fx.plot(); 
      -    }, 
      -     
      -    /* 
      -     Method: compute 
      -     
      -     Computes nodes' positions. 
      -
      -     Parameters:
      -
      -     property - _optional_ A <Graph.Node> position property to store the new positions. Possible values are 'pos', 'endPos' or 'startPos'.
      -
      -
      -    */ 
      -    compute: function(property) { 
      -        var prop = property || ['pos', 'startPos']; 
      -        var node = this.graph.getNode(this.root); 
      -        node._depth = 0; 
      -        Graph.Util.computeLevels(this.graph, this.root, 0, "ignore"); 
      -        this.computeAngularWidths(); 
      -        this.computePositions(prop); 
      -    }, 
      -     
      -    /* 
      -     computePositions 
      -     
      -     Performs the main algorithm for computing node positions.
      -
      -     Parameters:
      -
      -     property - A <Graph.Node> position property to store the new positions. Possible values are 'pos', 'endPos' or 'startPos'.
      -
      -  */ 
      -    computePositions: function(property) { 
      -        var propArray = $splat(property); 
      -        var aGraph = this.graph, GUtil = Graph.Util; 
      -        var root = this.graph.getNode(this.root), that = this, config = this.config; 
      -        var size = this.canvas.getSize(); 
      -        var scale = Math.min(size.width, size.height)/ 2; 
      - 
      - 
      -        //Set default values for the root node 
      -        for(var i=0; i<propArray.length; i++)  
      -            root[propArray[i]] = $P(0, 0); 
      -        root.angleSpan = { 
      -            begin: 0, 
      -            end: 2 * Math.PI 
      -        }; 
      -    root._rel = 1; 
      -     
      -        //Estimate better edge length. 
      -        var edgeLength = (function() { 
      -            var depth = 0; 
      -            GUtil.eachNode(aGraph, function(node) { 
      -                depth = (node._depth > depth)? node._depth : depth; 
      -        node._scale = scale; 
      -            }, "ignore"); 
      -            for(var i=0.51; i<=1; i+=0.01) { 
      -                var valSeries = (function(a, n) { 
      -                    return (1 - Math.pow(a, n)) / (1 - a); 
      -                })(i, depth + 1); 
      -                if(valSeries >= 2) return i - 0.01; 
      -            } 
      -            return 0.5; 
      -        })(); 
      -         
      -        GUtil.eachBFS(this.graph, this.root, function (elem) { 
      -            var angleSpan = elem.angleSpan.end - elem.angleSpan.begin; 
      -            var angleInit = elem.angleSpan.begin; 
      -            var totalAngularWidths = (function (element){ 
      -                var total = 0; 
      -                GUtil.eachSubnode(element, function(sib) { 
      -                    total += sib._treeAngularWidth; 
      -                }, "ignore"); 
      -                return total; 
      -            })(elem); 
      - 
      -            for(var i=1, rho = 0, lenAcum = edgeLength, depth = elem._depth; i<=depth+1; i++) { 
      -                rho += lenAcum; 
      -                lenAcum *= edgeLength; 
      -            } 
      -             
      -            GUtil.eachSubnode(elem, function(child) { 
      -                if(!child._flag) { 
      -                    child._rel = child._treeAngularWidth / totalAngularWidths; 
      -                    var angleProportion = child._rel * angleSpan; 
      -                    var theta = angleInit + angleProportion / 2; 
      - 
      -                    for(var i=0; i<propArray.length; i++) 
      -                        child[propArray[i]] = $P(theta, rho); 
      - 
      -                    child.angleSpan = { 
      -                        begin: angleInit, 
      -                        end: angleInit + angleProportion 
      -                    }; 
      -                    angleInit += angleProportion; 
      -                } 
      -            }, "ignore"); 
      - 
      -        }, "ignore"); 
      -    }, 
      -     
      -    /* 
      -     Method: onClick 
      -     
      -     Performs all calculations and animations to center the node specified by _id_.
      -
      -     Parameters:
      -
      -     id - A <Graph.Node> id.
      -     opt - _optional_ An object containing some extra properties like
      -
      -     - _hideLabels_ Hide labels when performing the animation. Default's *true*.
      -
      -     Example:
      -
      -     (start code js)
      -       ht.onClick('someid');
      -       //or also...
      -       ht.onClick('someid', {
      -        hideLabels: false
      -       });
      -      (end code)
      -      
      -    */ 
      -    onClick: function(id, opt) { 
      -        var pos = this.graph.getNode(id).pos.getc(true); 
      -        this.move(pos, opt); 
      -    }, 
      -     
      -    /* 
      -     Method: move 
      -
      -     Translates the tree to the given position. 
      -
      -     Parameters:
      -
      -     pos - A <Complex> number determining the position to move the tree to.
      -     opt - _optional_ An object containing some extra properties defined in <Hypertree.onClick>
      -
      -
      -    */ 
      -    move: function(pos, opt) { 
      -        var versor = $C(pos.x, pos.y); 
      -        if(this.busy === false && versor.norm() < 1) { 
      -            var GUtil = Graph.Util;
      -            this.busy = true; 
      -            var root = GUtil.getClosestNodeToPos(this.graph, versor), that = this;
      -            GUtil.computeLevels(this.graph, root.id, 0);
      -            this.controller.onBeforeCompute(root); 
      -            if (versor.norm() < 1) { 
      -                opt = $merge({ onComplete: $empty }, opt || {}); 
      -                this.fx.animate($merge({ 
      -                    modes: ['moebius'], 
      -                    hideLabels: true 
      -                }, opt, { 
      -                    onComplete: function(){ 
      -                        that.busy = false; 
      -                        opt.onComplete(); 
      -                    } 
      -                }), versor); 
      -            } 
      -        } 
      -    }    
      -}); 
      - 
      -/* 
      -   Class: Hypertree.Op 
      - 
      -   Performs advanced operations on trees and graphs.
      -
      -   Extends:
      -
      -   All <Graph.Op> methods
      -
      -   Access:
      -
      -   This instance can be accessed with the _op_ parameter of the hypertree instance created.
      -
      -   Example:
      -
      -   (start code js)
      -    var ht = new Hypertree(canvas, config);
      -    ht.op.morph //or can also call any other <Graph.Op> method
      -   (end code)
      -    
      -*/ 
      -Hypertree.Op = new Class({ 
      - 
      -    Implements: Graph.Op, 
      - 
      -    initialize: function(viz) { 
      -        this.viz = viz; 
      -    } 
      -}); 
      - 
      -/* 
      -   Class: Hypertree.Plot 
      - 
      -   Performs plotting operations.
      -
      -   Extends:
      -
      -   All <Graph.Plot> methods
      -
      -   Access:
      -
      -   This instance can be accessed with the _fx_ parameter of the hypertree instance created.
      -
      -   Example:
      -
      -   (start code js)
      -    var ht = new Hypertree(canvas, config);
      -    ht.fx.placeLabel //or can also call any other <Hypertree.Plot> method
      -   (end code)
      -
      -*/ 
      -Hypertree.Plot = new Class({ 
      - 
      -    Implements: Graph.Plot, 
      -   
      -  initialize: function(viz) { 
      -        this.viz = viz; 
      -        this.config = viz.config; 
      -    this.node = this.config.Node; 
      -    this.edge = this.config.Edge; 
      -        this.animation = new Animation; 
      -        this.nodeTypes = new Hypertree.Plot.NodeTypes; 
      -        this.edgeTypes = new Hypertree.Plot.EdgeTypes; 
      -  }, 
      -     
      -    /* 
      -       Method: hyperline 
      -     
      -       Plots a hyperline between two nodes. A hyperline is an arc of a circle which is orthogonal to the main circle. 
      -
      -       Parameters:
      -
      -       adj - A <Graph.Adjacence> object.
      -       canvas - A <Canvas> instance.
      -    */ 
      -    hyperline: function(adj, canvas) { 
      -        var node = adj.nodeFrom, child = adj.nodeTo, data = adj.data; 
      -        var pos = node.pos.getc(), posChild = child.pos.getc(); 
      -        var centerOfCircle = this.computeArcThroughTwoPoints(pos, posChild); 
      -        var size = canvas.getSize(); 
      -        var scale = Math.min(size.width, size.height)/2; 
      -        if (centerOfCircle.a > 1000 || centerOfCircle.b > 1000 || centerOfCircle.ratio > 1000) { 
      -            canvas.path('stroke', function(ctx) { 
      -                ctx.moveTo(pos.x * scale, pos.y * scale); 
      -                ctx.lineTo(posChild.x * scale, posChild.y * scale); 
      -      }); 
      -    } else { 
      -          var angleBegin = Math.atan2(posChild.y - centerOfCircle.y, posChild.x - centerOfCircle.x); 
      -          var angleEnd   = Math.atan2(pos.y - centerOfCircle.y, pos.x - centerOfCircle.x); 
      -          var sense      = this.sense(angleBegin, angleEnd); 
      -          var context = canvas.getCtx(); 
      -          canvas.path('stroke', function(ctx) { 
      -              ctx.arc(centerOfCircle.x*scale, centerOfCircle.y*scale, centerOfCircle.ratio*scale, angleBegin, angleEnd, sense); 
      -          }); 
      -    } 
      -    }, 
      -     
      -    /* 
      -       computeArcThroughTwoPoints 
      -     
      -       Calculates the arc parameters through two points.
      -       
      -       More information in <http://en.wikipedia.org/wiki/Poincar%C3%A9_disc_model#Analytic_geometry_constructions_in_the_hyperbolic_plane> 
      -
      -       Parameters:
      -
      -       p1 - A <Complex> instance.
      -       p2 - A <Complex> instance.
      -
      -       Returns:
      -
      -       An object containing some arc properties.
      -    */ 
      -    computeArcThroughTwoPoints: function(p1, p2) { 
      -        var aDen = (p1.x * p2.y - p1.y * p2.x), bDen = aDen; 
      -        var sq1 = p1.squaredNorm(), sq2 = p2.squaredNorm(); 
      -        //Fall back to a straight line 
      -        if (aDen == 0) return { x:0, y:0, ratio: 1001 }; 
      - 
      -        var a = (p1.y * sq2 - p2.y * sq1 + p1.y - p2.y) / aDen; 
      -        var b = (p2.x * sq1 - p1.x * sq2 + p2.x - p1.x) / bDen; 
      -        var x = -a / 2; 
      -        var y = -b / 2; 
      -        var squaredRatio = (a * a + b * b) / 4 -1; 
      -        //Fall back to a straight line         
      -        if(squaredRatio < 0) return { x:0, y:0, ratio: 1001 }; 
      -        var ratio = Math.sqrt(squaredRatio); 
      -        var out= { 
      -            x: x, 
      -            y: y, 
      -            ratio: ratio, 
      -            a: a, 
      -            b: b 
      -        }; 
      - 
      -        return out; 
      -  }, 
      - 
      -  /* 
      -     sense 
      -   
      -     Sets angle direction to clockwise (true) or counterclockwise (false). 
      -      
      -     Parameters: 
      -   
      -        angleBegin - Starting angle for drawing the arc. 
      -        angleEnd - The HyperLine will be drawn from angleBegin to angleEnd. 
      -   
      -     Returns: 
      -   
      -        A Boolean instance describing the sense for drawing the HyperLine. 
      -  */ 
      -  sense: function(angleBegin, angleEnd) { 
      -     return (angleBegin < angleEnd)? ((angleBegin + Math.PI > angleEnd)? false : true) :  
      -         ((angleEnd + Math.PI > angleBegin)? true : false); 
      -  }, 
      -   
      -
      -    /* 
      -      Method: placeLabel
      -
      -      Overrides abstract method placeLabel in <Graph.Plot>.
      -
      -      Parameters:
      -
      -      tag - A DOM label element.
      -      node - A <Graph.Node>.
      -      controller - A configuration/controller object passed to the visualization.
      -     
      -     */
      -    placeLabel: function(tag, node, controller) { 
      -      var pos = node.pos.getc(true), canvas = this.viz.canvas; 
      -      var radius= canvas.getSize(); 
      -      var scale = node._scale; 
      -      var labelPos= { 
      -          x: Math.round(pos.x * scale + radius.width/2), 
      -          y: Math.round(pos.y * scale + radius.height/2) 
      -      }; 
      -      var style = tag.style; 
      -      style.left = labelPos.x + 'px'; 
      -      style.top  = labelPos.y + 'px'; 
      -      style.display = ''; 
      -      controller.onPlaceLabel(tag, node); 
      -  } 
      -}); 
      -
      -/*
      -  Class: Hypertree.Plot.NodeTypes
      -
      -  Here are implemented all kinds of node rendering functions. 
      -  Rendering functions implemented are 'none', 'circle', 'triangle', 'rectangle', 'star' and 'square'.
      -
      -  You can add new Node types by implementing a new method in this class
      -
      -  Example:
      -
      -  (start code js)
      -    Hypertree.Plot.NodeTypes.implement({
      -      'newnodetypename': function(node, canvas) {
      -        //Render my node here.
      -      }
      -    });
      -  (end code)
      -
      -*/
      -Hypertree.Plot.NodeTypes = new Class({ 
      -    'none': function() {}, 
      -     
      -    'circle': function(node, canvas) { 
      -        var nconfig = this.node, data = node.data; 
      -        var nodeDim = nconfig.overridable && data && data.$dim || nconfig.dim; 
      -    var p = node.pos.getc(), pos = p.scale(node._scale); 
      -    var prod = nconfig.transform?  nodeDim * (1 - p.squaredNorm()) : nodeDim; 
      -    if(prod >= nodeDim / 4) { 
      -          canvas.path('fill', function(context) { 
      -              context.arc(pos.x, pos.y, prod, 0, Math.PI * 2, true);           
      -          }); 
      -    } 
      -    }, 
      -     
      -    'square': function(node, canvas) { 
      -        var nconfig = this.node, data = node.data; 
      -        var nodeDim = nconfig.overridable && data && data.$dim || nconfig.dim; 
      -        var p = node.pos.getc(), pos = p.scale(node._scale); 
      -        var prod = nconfig.transform?  nodeDim * (1 - p.squaredNorm()) : nodeDim; 
      -        var nodeDim2 = 2 * prod; 
      -        if (prod >= nodeDim / 4) { 
      -      canvas.getCtx().fillRect(pos.x - prod, pos.y - prod, nodeDim2, nodeDim2); 
      -    } 
      -    }, 
      - 
      -    'rectangle': function(node, canvas) { 
      -        var nconfig = this.node, data = node.data; 
      -        var width = nconfig.overridable && data && data.$width || nconfig.width; 
      -        var height = nconfig.overridable && data && data.$height || nconfig.height; 
      -        var p = node.pos.getc(), pos = p.scale(node._scale); 
      -    var prod = 1 - p.squaredNorm(); 
      -        width = nconfig.transform?  width * prod : width; 
      -    height = nconfig.transform?  height * prod : height; 
      -    if(prod >= 0.25) { 
      -            canvas.getCtx().fillRect(pos.x - width / 2, pos.y - height / 2, width, height);       
      -    } 
      - 
      -    }, 
      -     
      -    'triangle': function(node, canvas) { 
      -        var nconfig = this.node, data = node.data; 
      -        var nodeDim = nconfig.overridable && data && data.$dim || nconfig.dim; 
      -        var p = node.pos.getc(), pos = p.scale(node._scale); 
      -        var prod = nconfig.transform?  nodeDim * (1 - p.squaredNorm()) : nodeDim; 
      -        if (prod >= nodeDim / 4) { 
      -      var c1x = pos.x,  
      -      c1y = pos.y - prod,  
      -      c2x = c1x - prod,  
      -      c2y = pos.y + prod,  
      -      c3x = c1x + prod,  
      -      c3y = c2y; 
      -      canvas.path('fill', function(ctx){ 
      -        ctx.moveTo(c1x, c1y); 
      -        ctx.lineTo(c2x, c2y); 
      -        ctx.lineTo(c3x, c3y); 
      -      }); 
      -    } 
      -    }, 
      -     
      -    'star': function(node, canvas) { 
      -        var nconfig = this.node, data = node.data; 
      -        var nodeDim = nconfig.overridable && data && data.$dim || nconfig.dim; 
      -        var p = node.pos.getc(), pos = p.scale(node._scale); 
      -        var prod = nconfig.transform?  nodeDim * (1 - p.squaredNorm()) : nodeDim; 
      -        if (prod >= nodeDim / 4) { 
      -      var ctx = canvas.getCtx(), pi5 = Math.PI / 5; 
      -      ctx.save(); 
      -      ctx.translate(pos.x, pos.y); 
      -      ctx.beginPath(); 
      -      ctx.moveTo(nodeDim, 0); 
      -      for (var i = 0; i < 9; i++) { 
      -        ctx.rotate(pi5); 
      -        if (i % 2 == 0) { 
      -          ctx.lineTo((prod / 0.525731) * 0.200811, 0); 
      -        } 
      -        else { 
      -          ctx.lineTo(prod, 0); 
      -        } 
      -      } 
      -      ctx.closePath(); 
      -      ctx.fill(); 
      -      ctx.restore(); 
      -    } 
      -    } 
      -}); 
      - 
      - /*
      -  Class: Hypertree.Plot.EdgeTypes
      -
      -  Here are implemented all kinds of edge rendering functions. 
      -  Rendering functions implemented are 'none', 'line' and 'hyperline'.
      -
      -  You can add new Edge types by implementing a new method in this class
      -
      -  Example:
      -
      -  (start code js)
      -    Hypertree.Plot.EdgeTypes.implement({
      -      'newedgetypename': function(adj, canvas) {
      -        //Render my edge here.
      -      }
      -    });
      -  (end code)
      -
      -*/
      -Hypertree.Plot.EdgeTypes = new Class({ 
      -    'none': function() {}, 
      -     
      -    'line': function(adj, canvas) { 
      -    var s = adj.nodeFrom._scale; 
      -        var pos = adj.nodeFrom.pos.getc(true); 
      -        var posChild = adj.nodeTo.pos.getc(true); 
      -        canvas.path('stroke', function(context) { 
      -            context.moveTo(pos.x * s, pos.y * s); 
      -            context.lineTo(posChild.x * s, posChild.y * s); 
      -        }); 
      -    }, 
      - 
      -    'hyperline': function(adj, canvas) { 
      -    this.hyperline(adj, canvas); 
      -  } 
      -}); 
      -
      -
      -/*
      - * File: Treemap.js
      - * 
      - * Implements the <TM> class and other derived classes.
      - *
      - * Description:
      - *
      - * A Treemap is an information visualization technique, proven very useful when displaying large hierarchical structures on a constrained space. The idea behind a Treemap is to describe hierarchical relations as 'containment'. That means that if node B is child of node A, then B 'is contained' in A.
      - *
      - * Inspired by:
      - *
      - * Squarified Treemaps (Mark Bruls, Kees Huizing, and Jarke J. van Wijk) 
      - *
      - * <http://www.win.tue.nl/~vanwijk/stm.pdf>
      - *
      - * Tree visualization with tree-maps: 2-d space-filling approach (Ben Shneiderman)
      - *
      - * <http://hcil.cs.umd.edu/trs/91-03/91-03.html>
      - *
      - * Disclaimer:
      - *
      - * This visualization was built from scratch, taking only these papers as inspiration, and only shares some features with the Treemap papers mentioned above.
      - *
      - */
      -
      -/*
      -   Object: TM
      -
      -  Abstract Treemap object.
      -
      -   Implemented By:
      -    
      -    <TM.Squarified>, <TM.Strip> and <TM.SliceAndDice>.
      -
      -    Description:
      -    
      -    Implements layout and configuration options inherited by <TM.Squarified>, <TM.Strip> and <TM.SliceAndDice>.
      -
      -    All Treemap constructors take the same configuration object as parameter.
      -
      -    Two special _data_ keys are read from the JSON tree structure loaded by <Loader.loadJSON> to calculate 
      -    node's color and dimensions. These properties are $area (for nodes dimensions) and $color. Both of these properties are floats.
      -
      -    This means that the tree structure defined in <Loader.loadJSON> should now look more like this
      -
      -    (start code js)
      -        var json = {  
      -            "id": "aUniqueIdentifier",  
      -            "name": "usually a nodes name",  
      -            "data": {
      -                "$area": 33, //some float value
      -                "$color": 36, //-optional- some float value
      -                "some key": "some value",
      -                "some other key": "some other value"
      -             },  
      -            "children": [ 'other nodes or empty' ]  
      -        };  
      -    (end code)
      -
      -    If you want to know more about JSON tree structures and the _data_ property please read <Loader.loadJSON>.
      -
      -    Configuration:
      -
      -    *General*
      -
      -    - _rootId_ The id of the div container where the Treemap will be injected. Default's 'infovis'.
      -    - _orientation_ For <TM.Strip> and <TM.SliceAndDice> only. The layout algorithm orientation. Possible values are 'h' or 'v'.
      -    - _levelsToShow_ Max depth of the plotted tree. Useful when using the request method.
      -    - _addLeftClickHandler_ Add a left click event handler to zoom in the Treemap view when clicking a node. Default's *false*. 
      -    - _addRightClickHandler_ Add a right click event handler to zoom out the Treemap view. Default's *false*.
      -    - _selectPathOnHover_ If setted to *true* all nodes contained in the path between the hovered node and the root node will have an *in-path* CSS class. Default's *false*.
      -
      -    *Nodes*
      -    
      -    There are two kinds of Treemap nodes.
      -
      -    (see treemapnode.png)
      -
      -    Inner nodes are nodes having children, like _Pearl Jam_.
      -    
      -    These nodes are represented by three div elements. A _content_ element, a _head_ element (where the title goes) and a _body_ element, where the children are laid out.
      -    
      -    (start code xml)
      -    <div class="content">
      -      <div class="head">Pearl Jam</div>
      -      <div class="body">...other nodes here...</div>
      -    </div>
      -    (end code)
      -
      -      Leaves are optionally colored nodes laying at the "bottom" of the tree. For example, _Yield_, _Vs._ and _Riot Act_ are leaves.
      -
      -    These nodes are represented by two div elements. A _content_ element and a wrapped _leaf_ element
      -
      -    (start code xml)
      -    <div class="content">
      -      <div class="leaf">Yield</div>
      -    </div>
      -    (end code)
      -
      -    There are some configuration properties regarding Treemap nodes
      -
      -    - _titleHeight_ The height of the title (_head_) div container. Default's 13.
      -    - _offset_ The separation offset between the _content_ div element and its contained div(s). Default's 4.
      -
      -    *Color*
      -
      -    _Color_ is an object containing as properties
      -
      -    - _allow_ If *true*, the algorithm will check for the JSON node data _$color_ property to add some color to the Treemap leaves. 
      -    This color is calculated by interpolating a node's $color value range with a real RGB color range. 
      -    By specifying min|maxValues for the $color property and min|maxColorValues for the RGB counterparts, the visualization is able to 
      -    interpolate color values and assign a proper color to the leaf node. Default's *false*.
      -    - _minValue_ The minimum value expected for the $color value property. Used for interpolating. Default's -100.
      -    - _maxValue_ The maximum value expected for the $color value property. Used for interpolating. Default's 100.
      -    - _minColorValue_ A three-element RGB array defining the color to be assigned to the _$color_ having _minValue_ as value. Default's [255, 0, 50].
      -    - _maxColorValue_ A three-element RGB array defining the color to be assigned to the _$color_ having _maxValue_ as value. Default's [0, 255, 50].
      -
      -    *Tips*
      -
      -    _Tips_ is an object containing as properties
      -
      -    - _allow_ If *true*, a tooltip will be shown when a node is hovered. The tooltip is a div DOM element having "tip" as CSS class. Default's *false*. 
      -    - _offsetX_ An offset added to the current tooltip x-position (which is the same as the current mouse position). Default's 20.
      -    - _offsetY_ An offset added to the current tooltip y-position (which is the same as the current mouse position). Default's 20.
      -    - _onShow(tooltip, node, isLeaf, domElement)_ Implement this method to change the HTML content of the tooltip when hovering a node.
      -    
      -    Parameters:
      -      tooltip - The tooltip div element.
      -      node - The corresponding JSON tree node (See also <Loader.loadJSON>).
      -      isLeaf - Whether is a leaf or inner node.
      -      domElement - The current hovered DOM element.
      -    
      -    *Controller options*
      -
      -    You can also implement controller functions inside the configuration object. These functions are
      -    
      -    - _onBeforeCompute(node)_ This method is called right before performing all computation and animations to the JIT visualization.
      -    - _onAfterCompute()_ This method is triggered right after all animations or computations for the JIT visualizations ended.
      -    - _onCreateElement(content, node, isLeaf, elem1, elem2)_ This method is called on each newly created node. 
      -    
      -    Parameters:
      -      content - The div wrapper element with _content_ className.
      -      node - The corresponding JSON tree node (See also <Loader.loadJSON>).
      -      isLeaf - Whether is a leaf or inner node. If the node's an inner tree node, elem1 and elem2 will become the _head_ and _body_ div elements respectively. 
      -      If the node's a _leaf_, then elem1 will become the div leaf element.
      -    
      -    - _onDestroyElement(content, node, isLeaf, elem1, elem2)_ This method is called before collecting each node. Takes the same parameters as onCreateElement.
      -    - _request(nodeId, level, onComplete)_ This method is used for buffering information into the visualization. When clicking on an empty node,
      -    the visualization will make a request for this node's subtrees, specifying a given level for this subtree (defined by _levelsToShow_). Once the request is completed, the _onComplete_ 
      -object should be called with the given result.
      -
      -    See also <TM.Squarified>, <TM.SliceAndDice> and <TM.Strip>.
      -
      -
      -*/
      -this.TM = {
      -
      -  layout: {
      -    orientation: "h",
      -    vertical: function() { 
      -      return this.orientation == "v"; 
      -    },
      -    horizontal: function() { 
      -      return this.orientation == "h"; 
      -    },
      -    change: function() { 
      -      this.orientation = this.vertical()? "h" : "v"; 
      -    }
      -  },
      -  
      -  innerController: {
      -      onBeforeCompute:  $empty,
      -      onAfterCompute:   $empty,
      -      onComplete:       $empty,
      -      onCreateElement:  $empty,
      -      onDestroyElement: $empty,
      -      request:          false
      -    },
      -
      -    config: {
      -      orientation: "h",
      -      titleHeight: 13,
      -      rootId: 'infovis',
      -      offset:4,
      -      levelsToShow: 3,
      -      addLeftClickHandler: false,
      -      addRightClickHandler: false,
      -      selectPathOnHover: false,
      -            
      -      Color: {
      -        allow: false,
      -        minValue: -100,
      -        maxValue: 100,
      -        minColorValue: [255, 0, 50],
      -        maxColorValue: [0, 255, 50]
      -      },
      -            
      -      Tips: {
      -        allow: false,
      -        offsetX: 20,
      -        offsetY: 20,
      -        onShow: $empty
      -      }
      -    },
      -  
      -
      -  initialize: function(controller) {
      -    this.tree = null;
      -    this.shownTree = null;
      -    this.controller = this.config = $merge(this.config, 
      -                    this.innerController, 
      -                    controller);
      -    this.rootId = this.config.rootId;
      -    this.layout.orientation = this.config.orientation;
      -        //add tooltip
      -        if(this.config.Tips.allow && document.body) {
      -            var tip = document.getElementById('_tooltip') || document.createElement('div');
      -            tip.id = '_tooltip';
      -            tip.className = 'tip';
      -            var style = tip.style;
      -            style.position = 'absolute';
      -            style.display = 'none';
      -            style.zIndex = 13000;
      -            document.body.appendChild(tip);
      -            this.tip = tip;
      -        }
      -        
      -        //purge
      -        var that = this;
      -        var fn = function() {
      -            that.empty();
      -            if(window.CollectGarbage) window.CollectGarbage();
      -            delete fn;
      -        };
      -        if(window.addEventListener) {
      -            window.addEventListener('unload', fn, false);
      -        } else {
      -            window.attachEvent('onunload', fn);
      -        }
      -  },
      -
      -    /*
      -       Method: each
      -    
      -        Traverses head and leaf nodes applying a given function
      -
      -      Parameters:
      -      
      -        f - A function that takes as parameters the same as the onCreateElement and onDestroyElement methods described in <TM>.
      -    */
      -    each: function(f) {
      -        (function rec(elem) {
      -          if(!elem) return;
      -          var ch = elem.childNodes, len = ch.length;
      -          if(len > 0) {
      -              f.apply(this, [elem, len === 1, ch[0], ch[1]]);
      -          }
      -          if (len > 1) {
      -            for(var chi = ch[1].childNodes, i=0; i<chi.length; i++) {
      -                rec(chi[i]);
      -            }
      -          }  
      -        })($get(this.rootId).firstChild);
      -    },
      -
      -  /*
      -     toStyle
      -  
      -    Transforms a JSON into a CSS style string.
      -  */
      -  toStyle: function(obj) {
      -    var ans = "";
      -    for(var s in obj) ans += s + ":" + obj[s] + ";";
      -    return ans;
      -  },
      -
      -  /*
      -     leaf
      -  
      -    Returns a boolean value specifying if the node is a tree leaf or not.
      -  
      -     Parameters:
      -  
      -        tree - A tree node (which is also a JSON tree object of course). <http://blog.thejit.org>
      -
      -     Returns:
      -  
      -         A boolean value specifying if the node is a tree leaf or not.
      - 
      -  */
      -  leaf: function(tree) {
      -    return tree.children == 0;
      -  },
      -
      -  /*
      -     Method: createBox
      -  
      -    Constructs the proper DOM layout from a json node.
      -    
      -        If the node's an _inner node_, 
      -        this method calls <TM.contentBox>, <TM.bodyBox> and <TM.leafBox> 
      -        to create the following HTML structure
      -        
      -        (start code xml)
      -        <div class="content">
      -          <div class="head">[Node name]</div>
      -          <div class="body">[Node's children]</div>
      -        </div>
      -        (end code)
      -
      -        If the node's a leaf node, it creates the following structure 
      -        by calling <TM.contentBox>, <TM.leafBox>
      -
      -        (start code xml)
      -        <div class="content">
      -          <div class="leaf">[Node name]</div>
      -        </div>
      -        (end code)
      -
      -
      -     Parameters:
      -
      -        json - A JSON subtree. See also <Loader.loadJSON>. 
      -      	coord - A coordinates object specifying width, height, left and top style properties.
      -        html - html to inject into the _body_ element if the node is an inner Tree node.
      -
      -      Returns:
      -
      -          The HTML structure described above.
      -
      -      See also:
      -
      -        <TM>, <TM.contentBox>, <TM.bodyBox>, <TM.headBox>, <TM.leafBox>.
      -
      -  */
      -  createBox: function(json, coord, html) {
      -    var box;
      -    if(!this.leaf(json)) {
      -      box = this.headBox(json, coord) + this.bodyBox(html, coord);
      -    } else {
      -      box = this.leafBox(json, coord);
      -    }
      -    return this.contentBox(json, coord, box);
      -  },
      -  
      -  /*
      -     Method: plot
      -  
      -    Renders the Treemap.
      -
      -      Parameters:
      -
      -        json - A JSON tree structure preprocessed by some Treemap layout algorithm.
      -
      -      Returns:
      -
      -        The HTML to inject to the main visualization container.
      -
      -      See also:
      -
      -        <TM.createBox>.
      -
      -
      -  */
      -  plot: function(json) {
      -    var coord = json.coord, html = "";
      -    
      -    if(this.leaf(json)) 
      -      return this.createBox(json, coord, null);
      -    
      -    for(var i=0, ch=json.children; i<ch.length; i++) {
      -    	var chi = ch[i], chcoord = chi.coord;
      -    	//skip tiny nodes
      -    	if(chcoord.width * chcoord.height > 1) {
      -    		html+= this.plot(chi);	
      -    	}
      -    } 
      -    return this.createBox(json, coord, html);
      -  },
      -
      -
      -  /*
      -     Method: headBox
      -  
      -    Creates the _head_ div dom element that usually contains the name of a parent JSON tree node.
      -  
      -     Parameters:
      -  
      -        json - A JSON subtree. See also <Loader.loadJSON>.
      -        coord - width and height base coordinate object.
      -
      -     Returns:
      -  
      -         A new _head_ div dom element that has _head_ as class name.
      -
      -        See also:
      -
      -          <TM.createBox>.
      - 
      -  */
      -  headBox: function(json, coord) {
      -    var config = this.config, offst = config.offset;
      -    var c = {
      -      'height': config.titleHeight + "px",
      -      'width': (coord.width - offst) + "px",
      -      'left':  offst / 2 + "px"
      -    };
      -    return "<div class=\"head\" style=\"" + this.toStyle(c) + "\">"
      -         + json.name + "</div>";
      -  },
      -
      -  /*
      -     Method: bodyBox
      -  
      -    Creates the _body_ div dom element that usually contains a subtree dom element layout.
      -  
      -     Parameters:
      -  
      -        html - html that should be contained in the body html.
      -        coord - width and height base coordinate object.
      -
      -     Returns:
      -  
      -         A new _body_ div dom element that has _body_ as class name.
      - 
      -        See also:
      -
      -          <TM.createBox>.
      - 
      -  */
      -  bodyBox: function(html, coord) {
      -    var config = this.config,
      -    th = config.titleHeight,
      -    offst = config.offset;
      -    var c = {
      -      'width': (coord.width - offst) + "px",
      -      'height':(coord.height - offst - th) + "px",
      -      'top':   (th + offst / 2) +  "px",
      -      'left':  (offst / 2) + "px"
      -    };
      -    return "<div class=\"body\" style=\""
      -      + this.toStyle(c) +"\">" + html + "</div>";
      -  },
      -
      -
      -
      -  /*
      -     Method: contentBox
      -  
      -    Creates the _content_ div dom element that usually contains a _leaf_ div dom element or _head_ and _body_ div dom elements.
      -  
      -     Parameters:
      -  
      -        json - A JSON node. See also <Loader.loadJSON>. 
      -        coord - An object containing width, height, left and top coordinates.
      -        html - input html wrapped by this tag.
      -        
      -     Returns:
      -  
      -         A new _content_ div dom element that has _content_ as class name.
      -
      -       See also:
      -
      -          <TM.createBox>.
      - 
      -  */
      -  contentBox: function(json, coord, html) {
      -    var c = {};
      -    for(var i in coord) c[i] = coord[i] + "px";
      -    return "<div class=\"content\" style=\"" + this.toStyle(c) 
      -       + "\" id=\"" + json.id + "\">" + html + "</div>";
      -  },
      -
      -
      -  /*
      -     Method: leafBox
      -  
      -    Creates the _leaf_ div dom element that usually contains nothing else.
      -  
      -     Parameters:
      -  
      -        json - A JSON subtree. See also <Loader.loadJSON>. 
      -        coord - base with and height coordinate object.
      -        
      -     Returns:
      -  
      -         A new _leaf_ div dom element having _leaf_ as class name.
      - 
      -       See also:
      -
      -          <TM.createBox>.
      - 
      -
      -  */
      -  leafBox: function(json, coord) {
      -    var config = this.config;
      -    var backgroundColor = config.Color.allow && this.setColor(json), 
      -    offst = config.offset,
      -    width = coord.width - offst,
      -    height = coord.height - offst;
      -    var c = {
      -      'top':   (offst / 2)  + "px",
      -      'height':height + "px",
      -      'width': width + "px",
      -      'left': (offst / 2) + "px"
      -    };
      -    if(backgroundColor) c['background-color'] = backgroundColor;
      -    return "<div class=\"leaf\" style=\"" + this.toStyle(c) + "\">" 
      -        + json.name + "</div>";
      -  },
      -
      -
      -  /*
      -     Method: setColor
      -  
      -        Calculates an hexa color string based on the _$color_ data node property.  
      -  
      -          This method is called by <TM.leafBox> to assign an hexadecimal color to each leaf node.
      -          
      -          This color is calculated by making a linear interpolation between _$color_ max and min values and 
      -          RGB max and min values so that
      -
      -          > hex = (maxColorValue - minColorValue) / (maxValue - minValue) * (x - minValue) + minColorValue
      -
      -          where _x_ range is [minValue, maxValue] and 
      -
      -          - _minValue_
      -          - _maxValue_
      -          - _minColorValue_
      -          - _maxColorValue_
      -
      -        are defined in the <TM> configuration object.
      -
      -        This method is called by <TM.leafBox> iif _Color.allow_ is setted to _true_.
      -
      -        Sometimes linear interpolation for coloring is just not enough. In that case you can re-implement this 
      -        method so that it fits your coloring needs.
      -
      -        Some people might find useful to implement their own coloring interpolation method and to assign the resulting hex string 
      -        to the _$color_ property. In that case we could re-implement the <TM.setColor> method like this
      -
      -        (start code js)
      -          //TM.Strip, TM.SliceAndDice also work
      -          TM.Squarified.implement({
      -            'setColor': function(json) {
      -              return json.data.$color;
      -            }
      -          });
      -        (end code)
      -
      -      So that it returns the previously assigned hex string.
      -
      -     Parameters:
      -  
      -        json - A JSON tree node.
      -
      -     Returns:
      -  
      -         A String that represents a color in hex value.
      - 
      -  */
      -  setColor: function(json) {
      -    var c = this.config.Color,
      -    maxcv = c.maxColorValue,
      -    mincv = c.minColorValue,
      -    maxv = c.maxValue,
      -    minv = c.minValue,
      -    diff = maxv - minv,
      -    x = (json.data.$color - 0);
      -    //linear interpolation    
      -    var comp = function(i, x) { 
      -      return Math.round((((maxcv[i] - mincv[i]) / diff) * (x - minv) + mincv[i])); 
      -    };
      -    
      -    return $rgbToHex([ comp(0, x), comp(1, x), comp(2, x) ]);
      -  },
      -
      -  /*
      -     Method: enter
      -  
      -    Sets the _elem_ parameter as root and performs the layout.
      -  
      -     Parameters:
      -  
      -        elem - A JSON Tree node. See also <Loader.loadJSON>. 
      -  */
      -  enter: function(elem) {
      -    this.view(elem.parentNode.id);
      -  },
      -  
      -    /*
      -       Method: onLeftClick
      -    
      -        Sets the _elem_ parameter as root and performs the layout. 
      -        This method is called when _addLeftClickHandler_ is *true* and a 
      -        node is left-clicked. You can override this method to add some custom behavior 
      -        when the node is left clicked though.
      -        
      -        An Example for overriding this method could be
      -        (start code js)
      -        //TM.Strip or TM.SliceAndDice also work
      -        TM.Squarified.implement({
      -            'onLeftClick': function(elem) {
      -                //some custom code...
      -            }
      -        });
      -        (end code)
      -        
      -    
      -       Parameters:
      -    
      -          elem - A JSON Tree node. See also <Loader.loadJSON>.
      -          
      -       See also:
      -       
      -          <TM.enter>
      -    */
      -    onLeftClick: function(elem) {
      -        this.enter(elem);
      -    },
      -
      -  /*
      -     Method: out
      -  
      -    Sets the _parent_ node of the currently shown subtree as root and performs the layout.
      -  
      -  */
      -  out: function() {
      -    var parent = TreeUtil.getParent(this.tree, this.shownTree.id);
      -    if(parent) {
      -      if(this.controller.request)
      -        TreeUtil.prune(parent, this.config.levelsToShow);
      -      this.view(parent.id);
      -    }
      -  },
      -  
      -    /*
      -       Method: onRightClick
      -    
      -        Sets the _parent_ node of the currently shown subtree as root and performs the layout. 
      -        This method is called when _addRightClickHandler_ is *true* and a 
      -        node is right-clicked. You can override this method to add some custom behavior 
      -        when the node is right-clicked though.
      -
      -        An Example for overriding this method could be
      -        (start code js)
      -        //TM.Strip or TM.SliceAndDice also work
      -        TM.Squarified.implement({
      -            'onRightClick': function() {
      -                //some custom code...
      -            }
      -        });
      -        (end code)
      -
      -       See also:
      -       
      -          <TM.out>
      -
      -    */
      -    onRightClick: function() {
      -        this.out();
      -    },
      -
      -  /*
      -     Method: view
      -  
      -    Sets the root of the treemap to the specified node id and performs the layout.
      -  
      -     Parameters:
      -  
      -      id - A node identifier
      -  */
      -  view: function(id) {
      -    var config = this.config, that = this;
      -    var post = {
      -      onComplete: function() {
      -        that.loadTree(id);
      -        $get(config.rootId).focus();
      -      }
      -    };
      -
      -    if (this.controller.request) {
      -      var TUtil = TreeUtil;
      -      TUtil.loadSubtrees(TUtil.getSubtree(this.tree, id),
      -               $merge(this.controller, post));
      -    } else {
      -      post.onComplete();
      -    }
      -  },
      -  
      -  /*
      -     Method: resetPath
      -  
      -       Sets an 'in-path' className for _leaf_ and _head_ elements which belong to the path between the given tree node 
      -       and the visualization's root node.
      -  
      -     Parameters:
      -  
      -        tree - A JSON  tree node. See also <Loader.loadJSON>.
      -  */
      -  resetPath: function(tree) {
      -    var root = this.rootId, previous = this.resetPath.previous;
      -        this.resetPath.previous = tree || false;
      -        function getParent(c) { 
      -            var p = c.parentNode;
      -            return p && (p.id != root) && p;
      -         };
      -         function toggleInPath(elem, remove) {
      -            if(elem) {
      -                var container = $get(elem.id);
      -                if(container) {
      -                    var parent = getParent(container);
      -                    while(parent) {
      -                        elem = parent.childNodes[0];
      -                        if($hasClass(elem, 'in-path')) {
      -                            if(remove == undefined || !!remove) $removeClass(elem, 'in-path');
      -                        } else {
      -                            if(!remove) $addClass(elem, 'in-path');
      -                        }
      -                        parent = getParent(parent);
      -                    }
      -                }
      -            }
      -         };
      -         toggleInPath(previous, true);
      -         toggleInPath(tree, false);                
      -  },
      -
      -    
      -    /*
      -       Method: initializeElements
      -    
      -       Traverses the DOM tree applying the onCreateElement method.
      -
      -       The onCreateElement controller method should attach events and add some behavior to the DOM element
      -       node created. *By default, the Treemap wont add any event to its elements.*
      -    */
      -    initializeElements: function() {
      -      var cont = this.controller, that = this;
      -      var ff = $lambda(false), tipsAllow = cont.Tips.allow;
      -      this.each(function(content, isLeaf, elem1, elem2) {
      -          var tree = TreeUtil.getSubtree(that.tree, content.id);
      -          cont.onCreateElement(content, tree, isLeaf, elem1, elem2);
      -
      -          //eliminate context menu when right clicking
      -          if(cont.addRightClickHandler) elem1.oncontextmenu = ff;
      -
      -          //add click handlers
      -          if(cont.addLeftClickHandler || cont.addRightClickHandler) {
      -            $addEvent(elem1, 'mouseup', function(e) {
      -                var rightClick = (e.which == 3 || e.button == 2);
      -                if (rightClick) {
      -                    if(cont.addRightClickHandler) that.onRightClick();
      -                }                     
      -                else {
      -                    if(cont.addLeftClickHandler) that.onLeftClick(elem1);
      -                } 
      -                    
      -                //prevent default 
      -                if (e.preventDefault) 
      -                    e.preventDefault();
      -                else 
      -                    e.returnValue = false;
      -            });
      -          }
      -          
      -          //add path selection on hovering nodes
      -          if(cont.selectPathOnHover || tipsAllow) {
      -            $addEvent(elem1, 'mouseover', function(e){
      -                if(cont.selectPathOnHover) {
      -                    if (isLeaf) {
      -                        $addClass(elem1, 'over-leaf');
      -                    }
      -                    else {
      -                        $addClass(elem1, 'over-head');
      -                        $addClass(content, 'over-content');
      -                    }
      -                    if (content.id) 
      -                        that.resetPath(tree);
      -                }
      -                if(tipsAllow)
      -                    cont.Tips.onShow(that.tip, tree, isLeaf, elem1);
      -            });
      -            
      -            $addEvent(elem1, 'mouseout', function(e){
      -                if(cont.selectPathOnHover) {
      -                    if (isLeaf) {
      -                        $removeClass(elem1, 'over-leaf');
      -                    }
      -                    else {
      -                        $removeClass(elem1, 'over-head');
      -                        $removeClass(content, 'over-content');
      -                    }
      -                    that.resetPath();
      -                }
      -                if(tipsAllow)
      -                    that.tip.style.display = 'none';
      -            });
      -
      -            if(tipsAllow) {
      -                //Add mousemove event handler
      -                $addEvent(elem1, 'mousemove', function(e, win){
      -                    var tip = that.tip;
      -                    //get mouse position
      -                    win = win  || window;
      -                    e = e || win.event;
      -                    var doc = win.document;
      -                    doc = doc.html || doc.body;
      -                    var page = {
      -                        x: e.pageX || e.clientX + doc.scrollLeft,
      -                        y: e.pageY || e.clientY + doc.scrollTop
      -                    };
      -                    tip.style.display = '';
      -                    //get window dimensions
      -                    win = {
      -                        'height': document.body.clientHeight,
      -                        'width': document.body.clientWidth
      -                    };
      -                    //get tooltip dimensions
      -                    var obj = {
      -                      'width': tip.offsetWidth,
      -                      'height': tip.offsetHeight  
      -                    };
      -                    //set tooltip position
      -                    var style = tip.style, x = cont.Tips.offsetX, y = cont.Tips.offsetY;
      -                    style.top = ((page.y + y + obj.height > win.height)?  
      -                        (page.y - obj.height - y) : page.y + y) + 'px';
      -                    style.left = ((page.x + obj.width + x > win.width)? 
      -                        (page.x - obj.width - x) : page.x + x) + 'px';
      -                });
      -            }
      -          }
      -      });
      -    },
      -
      -    /*
      -       Method: destroyElements
      -    
      -       Traverses the tree applying the onDestroyElement method.
      -
      -       The onDestroyElement controller method should detach events and garbage collect the element.
      -       *By default, the Treemap adds some garbage collect facilities for IE.*
      -    */
      -    destroyElements: function() {
      -      if(this.controller.onDestroyElement != $empty) {
      -          var cont = this.controller, that = this;
      -          this.each(function(content, isLeaf, elem1, elem2) {
      -              cont.onDestroyElement(content, TreeUtil.getSubtree(that.tree, content.id), isLeaf, elem1, elem2);
      -          });
      -      }  
      -    },
      -    
      -    /*
      -       Method: empty
      -    
      -        Empties the Treemap container (trying also to garbage collect things).
      -    */
      -    empty: function() {
      -        this.destroyElements();
      -        $clean($get(this.rootId));
      -    },
      -
      -  /*
      -     Method: loadTree
      -  
      -    Loads the subtree specified by _id_ and plots it on the layout container.
      -  
      -     Parameters:
      -  
      -        id - A subtree id.
      -  */
      -  loadTree: function(id) {
      -    this.empty();
      -    this.loadJSON(TreeUtil.getSubtree(this.tree, id));
      -  }
      -  
      -};
      -
      -/*
      -   Class: TM.SliceAndDice
      -
      -  A JavaScript implementation of the Slice and Dice Treemap algorithm.
      -
      -  The <TM.SliceAndDice> constructor takes an _optional_ configuration object described in <TM>.
      -
      -    This visualization (as all other Treemap visualizations) is fed with JSON Tree structures.
      -
      -    The _$area_ node data key is required for calculating rectangles dimensions.
      -
      -    The _$color_ node data key is required if _Color_ _allow_ is *true* and is used for calculating 
      -    leaves colors.
      -
      -    Extends:
      -    <TM>
      -
      -    Parameters:
      -
      -    config - Configuration defined in <TM>.
      -
      -    Example:
      -
      -
      -  Here's a way of instanciating the <TM.SliceAndDice> will all its _optional_ configuration features
      -  
      -  (start code js)
      -
      -  var tm = new TM.SliceAndDice({
      -      orientation: "h",
      -    titleHeight: 13,
      -    rootId: 'infovis',
      -    offset:4,
      -    levelsToShow: 3,
      -        addLeftClickHandler: false,
      -        addRightClickHandler: false,
      -        selectPathOnHover: false,
      -            
      -    Color: {
      -      allow: false,
      -      minValue: -100,
      -      maxValue: 100,
      -      minColorValue: [255, 0, 50],
      -      maxColorValue: [0, 255, 50]
      -          },
      -          
      -          Tips: {
      -            allow: false,
      -            offsetX; 20,
      -            offsetY: 20,
      -            onShow: function(tooltip, node, isLeaf, domElement) {}
      -          },
      -            
      -          onBeforeCompute:  function(node) {
      -            //Some stuff on before compute...
      -          },
      -          onAfterCompute:   function() {
      -            //Some stuff on after compute...
      -          },
      -          onCreateElement:  function(content, node, isLeaf, head, body) {
      -            //Some stuff onCreateElement
      -          },
      -          onDestroyElement: function(content, node, isLeaf, head, body) {
      -            //Some stuff onDestroyElement
      -          },
      -        request:          false
      -    });
      -  tm.loadJSON(json);
      -
      -  (end code)
      -
      -*/
      -TM.SliceAndDice = new Class({
      -  Implements: TM,
      -  /*
      -     Method: loadJSON
      -  
      -    Loads the specified JSON tree and lays it on the main container.
      -  
      -     Parameters:
      -  
      -        json - A JSON Tree. See also <Loader.loadJSON>. 
      -  */
      -  loadJSON: function (json) {
      -    this.controller.onBeforeCompute(json);
      -    var container = $get(this.rootId),
      -    config = this.config,
      -    width = container.offsetWidth,
      -    height = container.offsetHeight;
      -    
      -    var p = {
      -      'coord': {
      -        'top': 0,
      -        'left': 0,
      -        'width':  width,
      -        'height': height + config.titleHeight + config.offset
      -      }
      -    };
      -    
      -    if(this.tree == null) this.tree = json;
      -    this.shownTree = json;
      -    this.compute(p, json, this.layout.orientation);
      -    container.innerHTML = this.plot(json);
      -        this.initializeElements();
      -    this.controller.onAfterCompute(json);
      -  },
      -  
      -  /*
      -     Method: compute
      -  
      -    Called by loadJSON to calculate recursively all node positions and lay out the tree.
      -  
      -     Parameters:
      -
      -        par - The parent node of the json subtree.  
      -        json - A JSON subtree. See also <Loader.loadJSON>.
      -        orientation - The current orientation. This value is switched recursively.
      -  */
      -  compute: function(par, json, orientation) {
      -    var config = this.config, 
      -    coord = par.coord,
      -    offst = config.offset,
      -    width  = coord.width - offst,
      -    height = coord.height - offst - config.titleHeight,
      -    pdata = par.data,
      -    fact = (pdata && ("$area" in pdata))? json.data.$area / pdata.$area : 1;
      -    var otherSize, size, dim, pos, pos2;
      -    
      -    var horizontal = (orientation == "h");
      -    if(horizontal) {
      -      orientation = 'v';    
      -      otherSize = height;
      -      size = Math.round(width * fact);
      -      dim = 'height';
      -      pos = 'top';
      -      pos2 = 'left';
      -    } else {
      -      orientation = 'h';    
      -      otherSize = Math.round(height * fact);
      -      size = width;
      -      dim = 'width';
      -      pos = 'left';
      -      pos2 = 'top';
      -    }
      -    json.coord = {
      -      'width':size,
      -      'height':otherSize,
      -      'top':0,
      -      'left':0
      -    };
      -    var offsetSize = 0, tm = this;
      -    $each(json.children, function(elem){
      -      tm.compute(json, elem, orientation);
      -      elem.coord[pos] = offsetSize;
      -      elem.coord[pos2] = 0;
      -      offsetSize += Math.floor(elem.coord[dim]);
      -    });
      -  }
      -});
      -
      -
      -/*
      -   Class: TM.Area
      -
      -  Abstract Treemap class containing methods that are common to
      -   aspect ratio related algorithms such as <TM.Squarified> and <TM.Strip>.
      -
      -    Implemented by:
      -
      -    <TM.Squarified>, <TM.Strip>
      -*/
      -TM.Area = new Class({
      -
      -  /*
      -     Method: loadJSON
      -  
      -    Loads the specified JSON tree and lays it on the main container.
      -  
      -     Parameters:
      -  
      -        json - A JSON tree. See also <Loader.loadJSON>.
      -  */
      -  loadJSON: function (json) {
      -    this.controller.onBeforeCompute(json);
      -    var container = $get(this.rootId),
      -    width = container.offsetWidth,
      -    height = container.offsetHeight,
      -    offst = this.config.offset,
      -    offwdth = width - offst,
      -    offhght = height - offst - this.config.titleHeight;
      -
      -    json.coord =  {
      -      'height': height,
      -      'width': width,
      -      'top': 0,
      -      'left': 0
      -    };
      -    var coord = $merge(json.coord, {
      -      'width': offwdth,
      -      'height': offhght
      -    });
      -
      -    this.compute(json, coord);
      -    container.innerHTML = this.plot(json);
      -    if(this.tree == null) this.tree = json;
      -    this.shownTree = json;
      -    this.initializeElements();
      -    this.controller.onAfterCompute(json);
      -  },
      -  
      -  /*
      -     Method: computeDim
      -  
      -    Computes dimensions and positions of a group of nodes
      -    according to a custom layout row condition. 
      -  
      -     Parameters:
      -
      -        tail - An array of nodes.  
      -          initElem - An array of nodes (containing the initial node to be laid).
      -        w - A fixed dimension where nodes will be layed out.
      -      	coord - A coordinates object specifying width, height, left and top style properties.
      -      	comp - A custom comparison function
      -  */
      -  computeDim: function(tail, initElem, w, coord, comp) {
      -    if(tail.length + initElem.length == 1) {
      -      var l = (tail.length == 1)? tail : initElem;
      -      this.layoutLast(l, w, coord);
      -      return;
      -    }
      -    if(tail.length >= 2 && initElem.length == 0) {
      -      initElem = [tail[0]];
      -      tail = tail.slice(1);
      -    }
      -    if(tail.length == 0) {
      -      if(initElem.length > 0) this.layoutRow(initElem, w, coord);
      -      return;
      -    }
      -    var c = tail[0];
      -    if(comp(initElem, w) >= comp([c].concat(initElem), w)) {
      -      this.computeDim(tail.slice(1), initElem.concat([c]), w, coord, comp);
      -    } else {
      -      var newCoords = this.layoutRow(initElem, w, coord);
      -      this.computeDim(tail, [], newCoords.dim, newCoords, comp);
      -    }
      -  },
      -
      -  
      -  /*
      -     Method: worstAspectRatio
      -  
      -    Calculates the worst aspect ratio of a group of rectangles. 
      -        
      -        See also:
      -        
      -        <http://en.wikipedia.org/wiki/Aspect_ratio>
      -    
      -     Parameters:
      -
      -      ch - An array of nodes.  
      -        w - The fixed dimension where rectangles are being laid out.
      -
      -     Returns:
      -  
      -         The worst aspect ratio.
      - 
      -
      -  */
      -  worstAspectRatio: function(ch, w) {
      -    if(!ch || ch.length == 0) return Number.MAX_VALUE;
      -    var areaSum = 0, maxArea = 0, minArea = Number.MAX_VALUE;
      -    for(var i=0; i<ch.length; i++) {
      -      var area = ch[i]._area;
      -      areaSum += area; 
      -      minArea = (minArea < area)? minArea : area;
      -      maxArea = (maxArea > area)? maxArea : area; 
      -    }
      -    var sqw = w * w, sqAreaSum = areaSum * areaSum;
      -    return Math.max(sqw * maxArea / sqAreaSum,
      -            sqAreaSum / (sqw * minArea));
      -  },
      -  
      -  /*
      -     Method: avgAspectRatio
      -  
      -    Calculates the average aspect ratio of a group of rectangles. 
      -        
      -        See also:
      -        
      -        <http://en.wikipedia.org/wiki/Aspect_ratio>
      -    
      -     Parameters:
      -
      -      ch - An array of nodes.  
      -        w - The fixed dimension where rectangles are being laid out.
      -
      -     Returns:
      -  
      -         The average aspect ratio.
      - 
      -
      -  */
      -  avgAspectRatio: function(ch, w) {
      -    if(!ch || ch.length == 0) return Number.MAX_VALUE;
      -    var arSum = 0;
      -    for(var i=0; i<ch.length; i++) {
      -      var area = ch[i]._area;
      -      var h = area / w;
      -      arSum += (w > h)? w / h : h / w;
      -    }
      -    return arSum / ch.length;
      -  },
      -
      -  /*
      -     layoutLast
      -  
      -    Performs the layout of the last computed sibling.
      -  
      -     Parameters:
      -
      -        ch - An array of nodes.  
      -        w - A fixed dimension where nodes will be layed out.
      -      coord - A coordinates object specifying width, height, left and top style properties.
      -  */
      -  layoutLast: function(ch, w, coord) {
      -    ch[0].coord = coord;
      -  }
      -  
      -});
      -
      -
      -
      -
      -/*
      -   Class: TM.Squarified
      -
      -  A JavaScript implementation of the Squarified Treemap algorithm.
      -
      -  The <TM.Squarified> constructor takes an _optional_ configuration object described in <TM>.
      -
      -    This visualization (as all other Treemap visualizations) is fed with JSON Tree structures.
      -
      -    The _$area_ node data key is required for calculating rectangles dimensions.
      -
      -    The _$color_ node data key is required if _Color_ _allow_ is *true* and is used for calculating 
      -    leaves colors.
      -
      -    Extends:
      -    <TM> and <TM.Area>
      -
      -    Parameters:
      -
      -    config - Configuration defined in <TM>.
      -
      -    Example:
      -
      -
      -  Here's a way of instanciating the <TM.Squarified> will all its _optional_ configuration features
      -  
      -  (start code js)
      -
      -  var tm = new TM.Squarified({
      -    titleHeight: 13,
      -    rootId: 'infovis',
      -    offset:4,
      -    levelsToShow: 3,
      -    addLeftClickHandler: false,
      -    addRightClickHandler: false,
      -    selectPathOnHover: false,
      -            
      -    Color: {
      -      allow: false,
      -      minValue: -100,
      -      maxValue: 100,
      -      minColorValue: [255, 0, 50],
      -      maxColorValue: [0, 255, 50]
      -    },
      -          
      -    Tips: {
      -      allow: false,
      -      offsetX: 20,
      -      offsetY: 20,
      -      onShow: function(tooltip, node, isLeaf, domElement) {}
      -    },
      -  
      -      onBeforeCompute:  function(node) {
      -        //Some stuff on before compute...
      -      },
      -      onAfterCompute:   function() {
      -        //Some stuff on after compute...
      -      },
      -      onCreateElement:  function(content, node, isLeaf, head, body) {
      -        //Some stuff onCreateElement
      -      },
      -      onDestroyElement: function(content, node, isLeaf, head, body) {
      -        //Some stuff onDestroyElement
      -      },
      -      request:          false
      -    });
      -  
      -  	tm.loadJSON(json);
      -
      -  (end code)
      -
      -*/
      -  
      -TM.Squarified = new Class({
      -  Implements: [TM, TM.Area],
      -
      -  /*
      -     Method: compute
      -  
      -    Called by loadJSON to calculate recursively all node positions and lay out the tree.
      -  
      -     Parameters:
      -
      -        json - A JSON tree. See also <Loader.loadJSON>.
      -      	coord - A coordinates object specifying width, height, left and top style properties.
      -  */
      -  compute: function(json, coord) {
      -    if (!(coord.width >= coord.height && this.layout.horizontal())) 
      -      this.layout.change();
      -    var ch = json.children, config = this.config;
      -    if(ch.length > 0) {
      -      this.processChildrenLayout(json, ch, coord);
      -      for(var i=0; i<ch.length; i++) {
      -        var chcoord = ch[i].coord,
      -        offst = config.offset,
      -        height = chcoord.height - (config.titleHeight + offst),
      -        width = chcoord.width - offst;
      -        coord = {
      -          'width':width,
      -          'height':height,
      -          'top':0,
      -          'left':0
      -        };
      -        this.compute(ch[i], coord);
      -      }
      -    }
      -  },
      -
      -  /*
      -     Method: processChildrenLayout
      -  
      -    Computes children real areas and other useful parameters for performing the Squarified algorithm.
      -  
      -     Parameters:
      -
      -        par - The parent node of the json subtree.  
      -        ch - An Array of nodes
      -      coord - A coordinates object specifying width, height, left and top style properties.
      -  */
      -  processChildrenLayout: function(par, ch, coord) {
      -    //compute children real areas
      -    var parentArea = coord.width * coord.height;
      -    var i, totalChArea=0, chArea = [];
      -    for(i=0; i < ch.length; i++) {
      -    	chArea[i] = parseFloat(ch[i].data.$area);
      -    	totalChArea += chArea[i];
      -    }
      -    for(i=0; i<chArea.length; i++) {
      -    	ch[i]._area = parentArea * chArea[i] / totalChArea;
      -    }
      -    var minimumSideValue = (this.layout.horizontal())? coord.height : coord.width;
      -    ch.sort(function(a, b) { return (a._area <= b._area) - (a._area >= b._area); });
      -    var initElem = [ch[0]];
      -    var tail = ch.slice(1);
      -    this.squarify(tail, initElem, minimumSideValue, coord);
      -  },
      -
      -  /*
      -    Method: squarify
      -  
      -    Performs an heuristic method to calculate div elements sizes in order to have a good aspect ratio.
      -  
      -     Parameters:
      -
      -        tail - An array of nodes.  
      -        initElem - An array of nodes, containing the initial node to be laid out.
      -        w - A fixed dimension where nodes will be laid out.
      -      	coord - A coordinates object specifying width, height, left and top style properties.
      -  */
      -  squarify: function(tail, initElem, w, coord) {
      -    this.computeDim(tail, initElem, w, coord, this.worstAspectRatio);
      -  },
      -  
      -  /*
      -     Method: layoutRow
      -  
      -    Performs the layout of an array of nodes.
      -  
      -     Parameters:
      -
      -        ch - An array of nodes.  
      -        w - A fixed dimension where nodes will be laid out.
      -      	coord - A coordinates object specifying width, height, left and top style properties.
      -  */
      -  layoutRow: function(ch, w, coord) {
      -    if(this.layout.horizontal()) {
      -      return this.layoutV(ch, w, coord);
      -    } else {
      -      return this.layoutH(ch, w, coord);
      -    }
      -  },
      -  
      -  layoutV: function(ch, w, coord) {
      -    var totalArea = 0, rnd = Math.round; 
      -    $each(ch, function(elem) { totalArea += elem._area; });
      -    var width = rnd(totalArea / w), top =  0; 
      -    for(var i=0; i<ch.length; i++) {
      -      var h = rnd(ch[i]._area / width);
      -      ch[i].coord = {
      -        'height': h,
      -        'width': width,
      -        'top': coord.top + top,
      -        'left': coord.left
      -      };
      -      top += h;
      -    }
      -    var ans = {
      -      'height': coord.height,
      -      'width': coord.width - width,
      -      'top': coord.top,
      -      'left': coord.left + width
      -    };
      -    //take minimum side value.
      -    ans.dim = Math.min(ans.width, ans.height);
      -    if(ans.dim != ans.height) this.layout.change();
      -    return ans;
      -  },
      -  
      -  layoutH: function(ch, w, coord) {
      -    var totalArea = 0, rnd = Math.round; 
      -    $each(ch, function(elem) { totalArea += elem._area; });
      -    var height = rnd(totalArea / w),
      -    top = coord.top, 
      -    left = 0;
      -    
      -    for(var i=0; i<ch.length; i++) {
      -      ch[i].coord = {
      -        'height': height,
      -        'width': rnd(ch[i]._area / height),
      -        'top': top,
      -        'left': coord.left + left
      -      };
      -      left += ch[i].coord.width;
      -    }
      -    var ans = {
      -      'height': coord.height - height,
      -      'width': coord.width,
      -      'top': coord.top + height,
      -      'left': coord.left
      -    };
      -    ans.dim = Math.min(ans.width, ans.height);
      -    if(ans.dim != ans.width) this.layout.change();
      -    return ans;
      -  }
      -});
      -
      -
      -/*
      -   Class: TM.Strip
      -
      -  A JavaScript implementation of the Strip Treemap algorithm.
      -
      -  The <TM.Strip> constructor takes an _optional_ configuration object described in <TM>.
      -
      -    This visualization (as all other Treemap visualizations) is fed with JSON Tree structures.
      -
      -    The _$area_ node data key is required for calculating rectangles dimensions.
      -
      -    The _$color_ node data key is required if _Color_ _allow_ is *true* and is used for calculating 
      -    leaves colors.
      -
      -    Extends:
      -    <TM> and <TM.Area>
      -
      -    Parameters:
      -    
      -    config - Configuration defined in <TM>.
      -
      -    Example:
      -
      -
      -  Here's a way of instanciating the <TM.Strip> will all its _optional_ configuration features
      -  
      -  (start code js)
      -
      -  var tm = new TM.Strip({
      -    titleHeight: 13,
      -      orientation: "h",
      -    rootId: 'infovis',
      -    offset:4,
      -    levelsToShow: 3,
      -        addLeftClickHandler: false,
      -        addRightClickHandler: false,
      -        selectPathOnHover: false,
      -            
      -    Color: {
      -      allow: false,
      -      minValue: -100,
      -      maxValue: 100,
      -      minColorValue: [255, 0, 50],
      -      maxColorValue: [0, 255, 50]
      -          },
      -          
      -          Tips: {
      -            allow: false,
      -            offsetX: 20,
      -            offsetY: 20,
      -            onShow: function(tooltip, node, isLeaf, domElement) {}
      -          },
      -  
      -          onBeforeCompute:  function(node) {
      -            //Some stuff on before compute...
      -          },
      -          onAfterCompute:   function() {
      -            //Some stuff on after compute...
      -          },
      -          onCreateElement:  function(content, node, isLeaf, head, body) {
      -            //Some stuff onCreateElement
      -          },
      -          onDestroyElement: function(content, node, isLeaf, head, body) {
      -            //Some stuff onDestroyElement
      -          },
      -        request:          false
      -    });
      -  tm.loadJSON(json);
      -
      -  (end code)
      -
      -*/
      -  
      -TM.Strip = new Class({
      -  Implements: [ TM, TM.Area ],
      -
      -  /*
      -     Method: compute
      -  
      -    Called by loadJSON to calculate recursively all node positions and lay out the tree.
      -  
      -     Parameters:
      -
      -        json - A JSON subtree. See also <Loader.loadJSON>. 
      -      coord - A coordinates object specifying width, height, left and top style properties.
      -  */
      -  compute: function(json, coord) {
      -    var ch = json.children, config = this.config;
      -    if(ch.length > 0) {
      -      this.processChildrenLayout(json, ch, coord);
      -      for(var i=0; i<ch.length; i++) {
      -        var chcoord = ch[i].coord,
      -        offst = config.offset,
      -        height = chcoord.height - (config.titleHeight + offst),
      -        width = chcoord.width - offst;
      -        coord = {
      -          'width':width,
      -          'height':height,
      -          'top':0,
      -          'left':0
      -        };
      -        this.compute(ch[i], coord);
      -      }
      -    }
      -  },
      -
      -  /*
      -     Method: processChildrenLayout
      -  
      -    Computes children real areas and other useful parameters for performing the Strip algorithm.
      -  
      -     Parameters:
      -
      -        par - The parent node of the json subtree.  
      -        ch - An Array of nodes
      -      coord - A coordinates object specifying width, height, left and top style properties.
      -  */
      -  processChildrenLayout: function(par, ch, coord) {
      -    //compute children real areas
      -    var area = coord.width * coord.height;
      -    var dataValue = parseFloat(par.data.$area);
      -    $each(ch, function(elem) {
      -      elem._area = area * parseFloat(elem.data.$area) / dataValue;
      -    });
      -    var side = (this.layout.horizontal())? coord.width : coord.height;
      -    var initElem = [ch[0]];
      -    var tail = ch.slice(1);
      -    this.stripify(tail, initElem, side, coord);
      -  },
      -
      -  /*
      -     Method: stripify
      -  
      -    Performs an heuristic method to calculate div elements sizes in order to have 
      -    a good compromise between aspect ratio and order.
      -  
      -     Parameters:
      -
      -        tail - An array of nodes.  
      -        initElem - An array of nodes.
      -        w - A fixed dimension where nodes will be layed out.
      -      coord - A coordinates object specifying width, height, left and top style properties.
      -  */
      -  stripify: function(tail, initElem, w, coord) {
      -    this.computeDim(tail, initElem, w, coord, this.avgAspectRatio);
      -  },
      -  
      -  /*
      -     Method: layoutRow
      -  
      -    Performs the layout of an array of nodes.
      -  
      -     Parameters:
      -
      -        ch - An array of nodes.  
      -        w - A fixed dimension where nodes will be laid out.
      -      	coord - A coordinates object specifying width, height, left and top style properties.
      -  */
      -  layoutRow: function(ch, w, coord) {
      -    if(this.layout.horizontal()) {
      -      return this.layoutH(ch, w, coord);
      -    } else {
      -      return this.layoutV(ch, w, coord);
      -    }
      -  },
      -  
      -  layoutV: function(ch, w, coord) {
      -	//TODO(nico): handle node dimensions properly
      -    var totalArea = 0, rnd = function(x) { return x; }; //Math.round; 
      -    $each(ch, function(elem) { totalArea += elem._area; });
      -    var width = rnd(totalArea / w), top =  0; 
      -    for(var i=0; i<ch.length; i++) {
      -      var h = rnd(ch[i]._area / width);
      -      ch[i].coord = {
      -        'height': h,
      -        'width': width,
      -        'top': coord.top + (w - h - top),
      -        'left': coord.left
      -      };
      -      top += h;
      -    }
      -
      -    var ans = {
      -      'height': coord.height,
      -      'width': coord.width - width,
      -      'top': coord.top,
      -      'left': coord.left + width,
      -      'dim': w
      -    };
      -    return ans;
      -  },
      -  
      -  layoutH: function(ch, w, coord) {
      -    var totalArea = 0, rnd = function(x) { return x; }; //Math.round; 
      -    $each(ch, function(elem) { totalArea += elem._area; });
      -    var height = rnd(totalArea / w),
      -    top = coord.height - height, 
      -    left = 0;
      -    
      -    for(var i=0; i<ch.length; i++) {
      -      ch[i].coord = {
      -        'height': height,
      -        'width': rnd(ch[i]._area / height),
      -        'top': top,
      -        'left': coord.left + left
      -      };
      -      left += ch[i].coord.width;
      -    }
      -    var ans = {
      -      'height': coord.height - height,
      -      'width': coord.width,
      -      'top': coord.top,
      -      'left': coord.left,
      -      'dim': w
      -    };
      -    return ans;
      -  }
      -});
      -
      -
      - })();
      \ No newline at end of file
      Index: src/main/resources/META-INF/static/images/delete.gif
      ===================================================================
      Cannot display: file marked as a binary type.
      svn:mime-type = application/octet-stream
      Index: src/main/resources/META-INF/static/images/wikipedia_w_16.png
      ===================================================================
      Cannot display: file marked as a binary type.
      svn:mime-type = application/octet-stream
      Index: src/main/resources/META-INF/static/images/compass_map_48.png
      ===================================================================
      Cannot display: file marked as a binary type.
      svn:mime-type = application/octet-stream
      Index: src/main/resources/META-INF/static/images/rdf_flyer_16.png
      ===================================================================
      Cannot display: file marked as a binary type.
      svn:mime-type = application/octet-stream
      Index: src/main/resources/META-INF/templates/imports/kres.ftl
      ===================================================================
      --- src/main/resources/META-INF/templates/imports/kres.ftl	(revision 1148250)
      +++ src/main/resources/META-INF/templates/imports/kres.ftl	(working copy)
      @@ -1,34 +0,0 @@
      -<#--
      -  Licensed to the Apache Software Foundation (ASF) under one or more
      -  contributor license agreements.  See the NOTICE file distributed with
      -  this work for additional information regarding copyright ownership.
      -  The ASF licenses this file to You under the Apache License, Version 2.0
      -  (the "License"); you may not use this file except in compliance with
      -  the License.  You may obtain a copy of the License at
      -
      -      http://www.apache.org/licenses/LICENSE-2.0
      -
      -  Unless required by applicable law or agreed to in writing, software
      -  distributed under the License is distributed on an "AS IS" BASIS,
      -  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
      -  See the License for the specific language governing permissions and
      -  limitations under the License.
      --->
      -<#macro form>
      -<form id="sparql" action="/kres" method="POST"
      - enctype="application/x-www-form-urlencoded"
      - accept="application/sparql-results+xml, application/rdf+xml">
      -<input type="text" class="url" name="databaseName" value="" >Database Name for NGraph</Input
      -<input type="text" class="url" name="namespace" value="" >Triples namespace
      -<input type="text" class="url" name="phisicalDBName" value="" >Phisical DB Name
      -<input type="text" class="url" name="jdbcDriver" value="" >JDBC Driver
      -<input type="text" class="url" name="protocol" value="" >Protocol
      -<input type="text" class="url" name="host" value="" >Host
      -<input type="text" class="url" name="port" value="" >Port
      -<input type="text" class="url" name="username" value="" >Username
      -<input type="text" class="url" name="password" value="" >Password
      -<p><input type="submit" class="submit" value="RDB Reengineering"/></p>
      -<pre class="prettyprint result" style="max-height: 200px; display: none" disabled="disabled">
      -</pre>
      -</form>
      -</#macro>
      \ No newline at end of file
      Index: src/main/resources/META-INF/static/style/kress.css
      ===================================================================
      --- src/main/resources/META-INF/static/style/kress.css	(revision 1148250)
      +++ src/main/resources/META-INF/static/style/kress.css	(working copy)
      @@ -1,83 +0,0 @@
      -/*
      -* Licensed to the Apache Software Foundation (ASF) under one or more
      -* contributor license agreements.  See the NOTICE file distributed with
      -* this work for additional information regarding copyright ownership.
      -* The ASF licenses this file to You under the Apache License, Version 2.0
      -* (the "License"); you may not use this file except in compliance with
      -* the License.  You may obtain a copy of the License at
      -*
      -*     http://www.apache.org/licenses/LICENSE-2.0
      -*
      -* Unless required by applicable law or agreed to in writing, software
      -* distributed under the License is distributed on an "AS IS" BASIS,
      -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
      -* See the License for the specific language governing permissions and
      -* limitations under the License.
      -*/
      -
      -* {margin:0; padding:0;}
      -
      -/******** General tags ********/
      -body {margin:25px auto; padding:0; font:76% Verdana,Tahoma,Arial,sans-serif; background:.1e3044; color:.303030; line-height:1.3em;}
      -a {text-decoration:none; color:.20526a; font-weight:bold;}
      -a:hover {text-decoration:underline; color:.20526a;}
      -a img {border:0;}
      -p {margin:0 0 18px 8px;}
      -h2 {font-size:1.5em; font-weight:normal; letter-spacing:-1px; margin:10px 0 8px 0;}
      -h3 {font-size:1.2em; margin:2px 0 8px 0;}
      -
      -/******** Main wrap ********/
      -#wrap {background:.ffffff url(images/wrapbg.gif) top left repeat-y; color:.303030; margin:0 auto; width:760px;}
      -
      -/******** Header ********/
      -.header {clear:both; background:url(images/header.jpg) top left no-repeat; height:150px;}
      -.header h1 {font-size:3.8em; letter-spacing:-4px; color:.d88d44; padding:55px 0 10px 45px;}
      -.header h1 a {color:.d88d44; text-decoration:none;}
      -.header h1 a:hover {color:.e99e55;}
      -.slogan {color:.20526a; margin:15px 0 0 45px; font-size:1.6em; letter-spacing:-1px;}
      -
      -/******** Sitemenu, left sidebar ********/
      -.sitemenu {clear:both; float:left; width:135px; margin:0; padding:20px 0 0 15px;}
      -.sitemenu ul {list-style:none; width:135px; margin:0 0 20px 0; padding:0; font-size:1.2em; letter-spacing:-1px;}
      -.sitemenu li {margin-bottom:4px;}
      -.sitemenu li a {font-weight:bold; text-decoration:none; color:.20526a; display:block; height:1.1em; padding:2px 2px 2px 8px; border-left: 8px solid .70a2ba;}
      -.sitemenu li a:hover {color:.d88d44; text-decoration:none; border-left:8px solid .d88d44;}
      -.sitemenu .current {border-left:8px solid .d88d44;}
      -.sitemenu ul ul {font-size:0.8em; width:110px; font-weight:normal; margin:5px 0 8px 20px;}
      -.sitemenu ul ul li {margin-bottom:2px;}
      -.sitemenu ul ul li a {border:0; padding:2px;}
      -.sitemenu ul ul li a:hover {border:0; padding:2px; text-decoration:underline;}
      -
      -/******** Extras, right sitebar ********/
      -.extras {float:right; width:135px; margin:0; padding:10px 15px 0 0;}
      -.extras ul {margin:0 0 14px 2px; list-style:none; color:.808080;}
      -.extras li {margin:0 0 2px 0;}
      -.extras li a {padding:2px 2px 2px 2px; height:1.2em; letter-spacing:-1px; font-weight:bold;}
      -.extras li a:hover {color:.d88d44;}
      -.extras ul ul, .extras ul ul ul {font-size:0.9em; line-height:1.2em; margin:2px 0 2px 15px;}
      -.extras ul ul a, .extras ul ul ul a {font-weight:normal;}
      -
      -/******** Content variations ********/
      -.content {margin:5px 170px 0 170px; padding:2px 0 0 0; line-height:1.5em; text-align:left;}
      -.content h2 {font-size:1.6em; margin:20px 0 10px 0;}
      -.content h3 {font-size:1.4em; font-weight:normal; letter-spacing:-1px; margin:10px 0 8px 0;}
      -.content p {text-align:justify;}
      -
      -/******** Footer ********/
      -.footer {clear:both; margin:5px auto 0 auto; padding:10px 0 10px 0; width:760px; text-align:center; background: url(images/footer.jpg) bottom left no-repeat; color:.555; font-size:0.9em; line-height:1.5em;}
      -.footer p {margin:3px;}
      -.footer p strong {font-size:1.1em; font-weight:400;}
      -.footer a {color:.777; font-weight:400; text-decoration:none;}
      -.footer a:hover {text-decoration:underline;}
      -
      -/******** Various classes ********/
      -.datetag {width:50px; padding:0 0 10px 0; text-align:center; background:.20526a url(images/date-bottom.gif) bottom left no-repeat; margin:2px 15px 1px 10px; color:.ffffff; font-size:2.2em; text-align:center; float:left;}
      -.datetag .date {width:50px; display:block; letter-spacing:-1px; padding:15px 0 5px 0; background:.20526a url(images/date-top.gif) top left no-repeat;}
      -.datetag .month {font-size:0.5em; letter-spacing:-1px; width:50px; display:block; font-weight:bold;}
      -.textright {text-align:right;}
      -.center {text-align:center;}
      -.frontphoto {margin:20px 0 10px 0;}
      -.small {font-size:0.8em;}
      -.bold {font-weight:bold;}
      -.clear {clear:both;}
      -.hide {display:none;}
      \ No newline at end of file
      Index: src/main/resources/META-INF/static/images/configure.gif
      ===================================================================
      Cannot display: file marked as a binary type.
      svn:mime-type = application/octet-stream
      Index: src/main/resources/META-INF/static/style/fise.css
      ===================================================================
      --- src/main/resources/META-INF/static/style/fise.css	(revision 1148250)
      +++ src/main/resources/META-INF/static/style/fise.css	(working copy)
      @@ -1,384 +0,0 @@
      -/*
      -* Licensed to the Apache Software Foundation (ASF) under one or more
      -* contributor license agreements.  See the NOTICE file distributed with
      -* this work for additional information regarding copyright ownership.
      -* The ASF licenses this file to You under the Apache License, Version 2.0
      -* (the "License"); you may not use this file except in compliance with
      -* the License.  You may obtain a copy of the License at
      -*
      -*     http://www.apache.org/licenses/LICENSE-2.0
      -*
      -* Unless required by applicable law or agreed to in writing, software
      -* distributed under the License is distributed on an "AS IS" BASIS,
      -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
      -* See the License for the specific language governing permissions and
      -* limitations under the License.
      -*/
      -body {
      -  font: normal 13px/20px Arial,Helvetica,sans-serif;
      -  padding: 0;
      -  margin: 0;
      -  background-color: #eff9f0;
      -}
      -
      -img {
      -  border: none;
      -}
      -
      -a:link, a:visited, a:hover {
      -  color: #c43187;
      -}
      -
      -a: active {
      -  color: black;  
      -}
      -
      -a:focus {
      -  outline: none;
      -}
      -
      -dt, dd {
      -  margin-top: 1em;
      -}
      -
      -pre, textarea {
      -  border: 1px solid #f8dcbb;
      -  padding: 1em;
      -  background-color: #f8f8f8;
      -  font-size: 90%;  
      -  overflow: auto;
      -}
      -
      -textarea {
      -  width: 100%;
      -}
      -
      -pre {
      -  white-space: pre-wrap;       /* css-3 */
      -  white-space: -moz-pre-wrap;  /* Mozilla, since 1999 */
      -  white-space: -pre-wrap;      /* Opera 4-6 */
      -  white-space: -o-pre-wrap;    /* Opera 7 */
      -  word-wrap: break-word;       /* Internet Explorer 5.5+ */  
      -}
      -
      -form  {
      -  margin-bottom: 2em;
      -}
      -
      -.home {
      -  position: absolute;
      -}
      -
      -.header {
      -  padding: 0.5em 1em;
      -  background: #4c4c4c url("/static/images/header_bg.png") repeat-x top left;  
      -  border-bottom: 1px solid black;
      -}
      -
      -.header h1 {
      -  float: left;
      -}
      -
      -.header .mainNavigationMenu {
      -  margin: 23px 1em 0;
      -  text-align: right;
      -}
      -
      -.header .mainNavigationMenu ul {
      -  display: inline;
      -}
      -
      -.header .mainNavigationMenu li {
      -  display: inline;
      -  margin-left: 0.5em;
      -  border: 1px solid transparent;
      -  padding: 0.3em 0.5em 0.5em 0.5em;
      -  border-radius: 8px;
      -}
      -
      -.header .mainNavigationMenu li.selected {
      -  border: 1px solid #222;
      -  background-color: #333;
      -}
      -
      -.header .mainNavigationMenu a {
      -  font-weight: bold;
      -  color: #EFF9F0;
      -}
      -
      -
      -h1 {
      -  color: #e9e9e9;
      -  font-size: 18px;
      -  font-weight: normal;
      -  margin: 22px 0 3px;
      -  padding: 0 0 0 160px;
      -  text-shadow: 0 1px 0 #000;
      -}
      -
      -h2 {
      -  padding: 0;
      -  margin: 1em 0;
      -  font-size: 16px;
      -}
      -
      -h3 {
      -  padding: 0;
      -  margin: 1em 0;
      -  font-size: 14px;
      -  font-weight:bold;
      -}
      -
      -.content {
      -  background-color: #fff;
      -  border-color: #d1dfce;
      -  border-style: solid;
      -  border-width: 0 1px 2px;
      -  margin: 0 auto 5em;
      -  padding: 0.5em 2em 1em;
      -  width: 75%;
      -}
      -
      -.content img {
      -  border: 1px solid gray;  
      -  max-width: 800px;  
      -}
      -
      -.content fieldset {
      -  border-color: #d1dfce;
      -  border-style: solid;
      -  border-width: 1px;
      -}
      -
      -.footer {
      -  background-color: #494949;
      -  border-top: 2px solid #373737;
      -  color: #d9d9d9;
      -  font-size: 85%;
      -  padding: 1em 1em 2em;
      -  text-shadow: 0 1px 0 #111111;
      -}
      -
      -.footer .column {
      -  float: left;
      -  width: 48%;
      -  padding: 0.5em;
      -}
      -
      -.column a img {
      -  border: 1px solid #373737;
      -}
      -
      -.footer img.swcube {
      -  padding: 6px;
      -  background-color: white;  
      -}
      -
      -.right {
      -  text-align: right;
      -} 
      -
      -table {
      -  text-align: left;
      -  width: 100%;
      -}
      -
      -.storeContents table {
      -  border-collapse: collapse;
      -  margin: 5px 0 0px;
      -}
      -
      -.storeContents th {  
      -  color: #000;
      -  font-size: 105%;
      -  font-weight: normal;
      -  padding: 6px 10px;
      -  border-bottom: 1px solid #d1dfce;
      -  background-color:#f8f8f8;
      -}
      -
      -.storeContents th img {
      -  vertical-align: top;
      -  border: medium none;
      -  margin: 0 0.1em;
      -}
      -
      -.storeContents td {
      -  padding: 4px 10px 5px;
      -  border-bottom: 1px solid #ffe8f9;
      -}
      -
      -.content input.url {
      -  width: 600px;
      -}
      -
      -.content .contentItemPreview pre {
      -  max-height: 200px;  
      -}
      -
      -.content table {
      -  font-size: 95%; 
      -}
      -
      -.entitylistings {
      -  margin-top: 20px;
      -  }
      -
      -.entitylisting h3 {
      -  text-align: center;  
      -}
      -
      -.entitylisting {
      -  float: left;
      -  width: 33%;
      -  margin: auto;
      -}
      -
      -.entitylisting p {
      -  margin: 0.2em;
      -}
      -
      -.entitylisting table {
      -  border: 1px solid #eee;
      -  border-radius: 8px;
      -  background: url("/static/images/foldable_unfolded.png") no-repeat scroll right 17px transparent;
      -}
      -
      -.entitylisting table.collapsed {
      -  background: url("/static/images/foldable_folded.png") no-repeat scroll right center transparent;
      -  }
      -
      -.entitylisting .subheader {
      -  height: 25px;
      -}
      -
      -.entitylisting .subheader td {
      -  background-color: #f9f9f9;
      -  border-bottom: 1px solid #eee;
      -  border-top: 1px solid #eee;
      -  font-weight: bold;
      -  padding: 0 10px;
      -}
      -
      -.entitylisting img {
      -  vertical-align: middle;
      -  border: 1px solid transparent;
      -}
      -
      -.entitylisting .thumb {
      -  width: 50px;
      -}
      -
      -.entitylisting thead {
      -  cursor: pointer;
      -}
      -
      -.entitylisting tbody{
      -  background-color: #fcfcfc;
      -  }
      -
      -.entitylisting tbody tr {
      -  height: 42px;
      -}
      -
      -.entitylisting .collapsed tbody tr {
      -  display: none;
      -}
      -
      -.downloadLinks, .previousNext {
      -  list-style: none;
      -  text-align: right;
      -  padding: 0;
      -  }
      -
      -.downloadLinks li, .previousNext li {
      -  border: 1px solid #c3c3c3;
      -  display: inline;
      -  margin: 0 0 0 30px;
      -  padding: 4px 6px 5px;
      -  background-color: #fafafa;
      -  }
      -
      -.downloadLinks li a, .previousNext li a {
      -  color: #333;
      -  text-decoration: none;
      -  }
      -
      -.downloadLinks li a:hover, .previousNext li a:hover {
      -  text-decoration: underline;
      -  }
      -
      -li.older a {
      -  background: url("/static/images/next.png") no-repeat scroll right center transparent;
      -  padding: 0 12px 0 0;
      -  }
      -  
      -li.moreRecent a {
      -  background: url("/static/images/previous.png") no-repeat scroll left center transparent;
      -  padding: 0 0 0 13px;
      -  }
      -
      -.download {
      -  background: url("/static/images/download.png") no-repeat scroll left center transparent;
      -  padding: 0 0 2px 20px;
      -  }
      -
      -.downloadRDF {
      -  background: url("/static/images/download_rdf.png") no-repeat scroll left center transparent;
      -  padding: 0 0 2px 20px;
      -  }
      -
      -.external {
      -  background: url("/static/images/external.png") no-repeat scroll right center transparent;
      -  padding: 0 18px 0 0;
      -  }
      -  
      -#enginesOuputWaiter {
      -  opacity: 90%;
      -  font-style: italic;
      -  text-align: center;  
      -}
      -
      -#enginesOuput pre {
      -  max-height: 200px;
      -}
      -
      -.enginelisting {
      -  padding: 0.5em;
      -  border: 1px solid #eee;
      -  border-radius: 8px;
      -}
      -
      -.enginelisting .collapseheader {
      -  margin: 0.1em;
      -  cursor: pointer;
      -  background: url("/static/images/foldable_unfolded.png") no-repeat scroll right center transparent;
      -}
      -
      -.enginelisting .collapsed .collapseheader {
      -  background: url("/static/images/foldable_folded.png") no-repeat scroll right center transparent;
      -}
      -
      -.enginelisting ul {
      -  padding-left: 0;
      -}
      -
      -.enginelisting .collapsed .collapsable {
      -  display: none;
      -}
      -
      -.enginelisting li {
      -  list-style: none;
      -  padding-left: 20px; 
      -  background: transparent url(/static/images/black_gear_16.png) no-repeat scroll 0% 50%;
      -}
      -
      -#enginesInput .submitButtons {
      -  text-align: right;  
      -}
      -
      -p.note {
      -  font-size: 90%;
      -  font-style: italic;
      -  text-align: right;
      -}
      \ No newline at end of file
      Index: src/main/resources/META-INF/static/scripts/prettify/prettify.css
      ===================================================================
      --- src/main/resources/META-INF/static/scripts/prettify/prettify.css	(revision 1148250)
      +++ src/main/resources/META-INF/static/scripts/prettify/prettify.css	(working copy)
      @@ -1,44 +0,0 @@
      -/*
      -  Licensed to the Apache Software Foundation (ASF) under one or more
      -  contributor license agreements.  See the NOTICE file distributed with
      -  this work for additional information regarding copyright ownership.
      -  The ASF licenses this file to You under the Apache License, Version 2.0
      -  (the "License"); you may not use this file except in compliance with
      -  the License.  You may obtain a copy of the License at
      -
      -      http://www.apache.org/licenses/LICENSE-2.0
      -
      -  Unless required by applicable law or agreed to in writing, software
      -  distributed under the License is distributed on an "AS IS" BASIS,
      -  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
      -  See the License for the specific language governing permissions and
      -  limitations under the License.
      -*/
      -
      -/* Pretty printing styles. Used with prettify.js. */
      -
      -.str { color: #080; }
      -.kwd { color: #008; }
      -.com { color: #800; }
      -.typ { color: #606; }
      -.lit { color: #066; }
      -.pun { color: #660; }
      -.pln { color: #000; }
      -.tag { color: #008; }
      -.atn { color: #606; }
      -.atv { color: #080; }
      -.dec { color: #606; }
      -pre.prettyprint { padding: 2px; border: 1px solid #888; }
      -
      -@media print {
      -  .str { color: #060; }
      -  .kwd { color: #006; font-weight: bold; }
      -  .com { color: #600; font-style: italic; }
      -  .typ { color: #404; font-weight: bold; }
      -  .lit { color: #044; }
      -  .pun { color: #440; }
      -  .pln { color: #000; }
      -  .tag { color: #006; font-weight: bold; }
      -  .atn { color: #404; }
      -  .atv { color: #060; }
      -}
      Index: src/main/resources/META-INF/templates/imports/common.ftl
      ===================================================================
      --- src/main/resources/META-INF/templates/imports/common.ftl	(revision 1148250)
      +++ src/main/resources/META-INF/templates/imports/common.ftl	(working copy)
      @@ -1,85 +0,0 @@
      -<#--
      -  Licensed to the Apache Software Foundation (ASF) under one or more
      -  contributor license agreements.  See the NOTICE file distributed with
      -  this work for additional information regarding copyright ownership.
      -  The ASF licenses this file to You under the Apache License, Version 2.0
      -  (the "License"); you may not use this file except in compliance with
      -  the License.  You may obtain a copy of the License at
      -
      -      http://www.apache.org/licenses/LICENSE-2.0
      -
      -  Unless required by applicable law or agreed to in writing, software
      -  distributed under the License is distributed on an "AS IS" BASIS,
      -  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
      -  See the License for the specific language governing permissions and
      -  limitations under the License.
      --->
      -<#macro page title>
      -<html>
      -  <head>
      -
      -    <title>KReS Platform - ${title?html}</title>
      -    <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
      -
      -    <link rel="stylesheet" href="/kres/static/style/kres.css" title="KReS Style" media="screen,projection" /> 
      - 
      - 	<link rel="icon" type="image/png" href="/kres/static/images/kresLogoExtended.png" />
      - 	
      -    <script type="text/javascript" src="/kres/static/scripts/jquery-1.4.2.js"></script>
      -    <script type="text/javascript" src="/kres/static/scripts/kres.js"></script>
      -    <script type="text/javascript" src="/kres/static/scripts/jquery.rdfquery.core-1.0.js"></script>
      -    <script type="text/javascript" src="/kres/static/scripts/tinybox.js"></script>
      -    <script type="text/javascript" src="/kres/static/scripts/jit-yc.js"></script>
      -
      -  </head>
      -  <body> <div id="wrap">
      -  		<div id="header">
      -  			<div id="leftHeader">
      -  				<h1><a href="/kres"><img alt="KReS Logo" src="/kres/static/images/kresLogoExtended.png" width="110" height="112"></a></h1>
      -  			</div>
      -  			<div id="rightHeader">
      -  				<p id="slogan">The Knowledge Representation and Reasoning System!</p>
      -  			</div> 
      -			 
      -		</div>  
      -		
      -		<#if it?exists && it.mainMenuItems?exists>
      -		<div id="sitemenu"> 
      -			<h2 class="hide">KReS menu:</h2> 
      -			<ul> 
      -				<#list it.mainMenuItems as item>
      -					<li><a class="${item.cssClass}" href="${item.link}">${item.label}</a>
      -					<#if item.subMenu?exists>
      -						<div id="${item.id}" class="hide">
      -							<ul>
      -							<#list item.subMenu as subItem>
      -								<a class="${subItem.cssClass}" href="${subItem.link}">${subItem.label}</a></li>
      -							</#list>
      -							</ul>	
      -						</div>
      -					</#if>
      -					</li>
      -				</#list> 
      -			</ul> 
      -			<h2><a href="http://stlab.istc.cnr.it/stlab/The_Semantic_Technology_Laboratory_(STLab)"><img src="/kres/static/images/stlabLogo.jpg" width="80" height="40"></a></h2>
      -		</div> 
      -		</#if>
      -		
      -	    <div id="content">
      -	      <h2>${title?html}</h2>
      -	      <#nested>
      -	    </div>
      -	
      -		<div id="footer">
      -		
      -		  <a href="http://www.w3.org/standards/semanticweb/"><img class="swcube"
      -		    src="/kres/static/images/sw-cube.png"/></a>
      -	      <a href="http://www.iks-project.eu"><img
      -	        height="60px" alt="IKS Project" src="/kres/static/images/iks_project_logo.jpg" /></a>
      -	      <p><em>The research leading to these results has received funding from the European Community's
      -	          Seventh Framework Programme (FP7/2007-2013) under grant agreement n° 231527</em></p>
      -	   </div>
      -	</div>
      -  </body>
      -</html>
      -</#macro>
      Index: src/main/resources/META-INF/static/images/kresLogoExtended.png
      ===================================================================
      Cannot display: file marked as a binary type.
      svn:mime-type = application/octet-stream
      Index: src/main/resources/META-INF/templates/ajax/contentitem.ftl
      ===================================================================
      --- src/main/resources/META-INF/templates/ajax/contentitem.ftl	(revision 1148250)
      +++ src/main/resources/META-INF/templates/ajax/contentitem.ftl	(working copy)
      @@ -1,25 +0,0 @@
      -<#--
      -  Licensed to the Apache Software Foundation (ASF) under one or more
      -  contributor license agreements.  See the NOTICE file distributed with
      -  this work for additional information regarding copyright ownership.
      -  The ASF licenses this file to You under the Apache License, Version 2.0
      -  (the "License"); you may not use this file except in compliance with
      -  the License.  You may obtain a copy of the License at
      -
      -      http://www.apache.org/licenses/LICENSE-2.0
      -
      -  Unless required by applicable law or agreed to in writing, software
      -  distributed under the License is distributed on an "AS IS" BASIS,
      -  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
      -  See the License for the specific language governing permissions and
      -  limitations under the License.
      --->
      -<#import "/imports/contentitem.ftl" as contentitem>
      -<#escape x as x?html>
      -
      -<@contentitem.view />
      -
      -<h3>Raw RDF output</h3>
      -<pre>${it.rdfMetadata}</pre>
      -</div>
      -</#escape>
      \ No newline at end of file
      Index: src/main/resources/META-INF/static/images/compass_48.png
      ===================================================================
      Cannot display: file marked as a binary type.
      svn:mime-type = application/octet-stream
      Index: src/main/resources/META-INF/static/images/download_rdf.png
      ===================================================================
      Cannot display: file marked as a binary type.
      svn:mime-type = application/octet-stream
      Index: src/main/resources/META-INF/static/images/header_bg.png
      ===================================================================
      Cannot display: file marked as a binary type.
      svn:mime-type = application/octet-stream